-
-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(binder): should bind on penetrate node whatevent plugin want to l…
…isten to event related to #128
- Loading branch information
1 parent
7c6301a
commit 8a18fb5
Showing
5 changed files
with
54 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import Chimee from 'index'; | ||
test('chimee penetrate event forward bug', () => { | ||
const fn = jest.fn(); | ||
const plugin1 = { | ||
name: 'plugin1', | ||
penetrate: false, | ||
inited() { | ||
this.$on('click', fn); | ||
}, | ||
}; | ||
const plugin2 = { | ||
name: 'plugin2', | ||
penetrate: true, | ||
}; | ||
Chimee.install(plugin1); | ||
Chimee.install(plugin2); | ||
const player = new Chimee({ | ||
wrapper: document.createElement('div'), | ||
plugins: [ | ||
plugin1.name, | ||
plugin2.name, | ||
], | ||
}); | ||
player.$plugins.plugin2.$dom.click(); | ||
expect(fn).toHaveBeenCalledTimes(1); | ||
player.destroy(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters