-
-
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.
- Loading branch information
Showing
11 changed files
with
804 additions
and
3 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 |
---|---|---|
|
@@ -8,5 +8,6 @@ doc/ | |
flow/ | ||
node_modules/ | ||
tool/ | ||
bundle-size/ | ||
.babelrc | ||
.flowconfig |
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,26 @@ | ||
import Chimee from 'index'; | ||
test('redudant event bind on video', () => { | ||
const wrapper = document.createElement('div'); | ||
const fn = jest.fn(); | ||
const cfn = jest.fn(); | ||
const wfn = jest.fn(); | ||
const plugin = { | ||
name: 'redudantEventBind', | ||
events: { | ||
click: fn, | ||
c_click: cfn, | ||
w_click: wfn | ||
} | ||
}; | ||
Chimee.install(plugin); | ||
const player = new Chimee({ | ||
wrapper, | ||
plugin: ['redudantEventBind'] | ||
}); | ||
player.__dispatcher.dom.videoElement.dispatchEvent(new Event('click')); | ||
expect(fn).toHaveBeenCalledTimes(1); | ||
player.__dispatcher.dom.container.dispatchEvent(new Event('click')); | ||
expect(cfn).toHaveBeenCalledTimes(1); | ||
player.__dispatcher.dom.wrapper.dispatchEvent(new Event('click')); | ||
expect(wfn).toHaveBeenCalledTimes(1); | ||
}); |
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
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
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