mirror of
https://github.com/videojs/video.js.git
synced 2025-07-17 01:42:41 +02:00
Wrote a test for controls changes.
This commit is contained in:
@ -231,3 +231,22 @@ test('should be able to initialize player twice on the same tag using string ref
|
|||||||
//here it triggers error, because player was destroyed already after first dispose
|
//here it triggers error, because player was destroyed already after first dispose
|
||||||
player.dispose();
|
player.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('should set controls and trigger event', function() {
|
||||||
|
expect(3);
|
||||||
|
|
||||||
|
var player = PlayerTest.makePlayer({ 'controls': false });
|
||||||
|
ok(player.controls() === false, 'controls set through options');
|
||||||
|
player.controls(true);
|
||||||
|
ok(player.controls() === true, 'controls updated');
|
||||||
|
|
||||||
|
player.on('controlschange', function(){
|
||||||
|
ok(true, 'controlschange fired once');
|
||||||
|
});
|
||||||
|
player.controls(false);
|
||||||
|
// Check for unnecessary controlschange events
|
||||||
|
player.controls(false);
|
||||||
|
|
||||||
|
player.dispose();
|
||||||
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user