Skip to content

Commit

Permalink
[update] modify fullscreenchange event
Browse files Browse the repository at this point in the history
what:
why:
how:
  • Loading branch information
toxic-johann committed Sep 5, 2017
1 parent 91a5fb0 commit 6dc1f30
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
13 changes: 13 additions & 0 deletions __tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,19 @@ describe('isFullscreen and fullscreenElement', () => {
document.body.removeChild(wrapper);
});

test('fullscreen event and fullscreenchange event', () => {
const fn = jest.fn();
const changeFn = jest.fn();
player.on('fullscreen', fn);
player.on('fullscreenchange', changeFn);
player.fullscreen();
expect(fn).toHaveBeenCalledTimes(1);
expect(changeFn).toHaveBeenCalledTimes(1);
player.fullscreen(false);
expect(fn).toHaveBeenCalledTimes(2);
expect(changeFn).toHaveBeenCalledTimes(2);
});

describe('$video, $container and $wrapper', () => {
const wrapper = document.createElement('div');
player = new Chimee(wrapper);
Expand Down
4 changes: 0 additions & 4 deletions src/helper/const.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,6 @@ export const domEvents = [
'select',
'wheel',
'fullscreenchange',
'webkitfullscreenchange',
'mozfullscreenchange',
'msfullscreenchange',
'MSFullscreenChange',
'contextmenu'
];
export const selfProcessorEvents = [
Expand Down

0 comments on commit 6dc1f30

Please sign in to comment.