1
0
mirror of https://github.com/videojs/video.js.git synced 2024-11-24 08:42:25 +02:00

test: fix modal dialog test for showing controls (#4707)

Also, add a test that verifies the behavior for the PR (#4690).

Fixes #4706.
This commit is contained in:
Gary Katsevman 2017-10-31 11:35:01 -04:00 committed by GitHub
parent 79639138ba
commit 45a6b3010d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -310,6 +310,7 @@ QUnit.test('open() does not pause, close() does not play() with pauseOnOpen set
});
QUnit.test('open() hides controls, close() shows controls', function(assert) {
this.player.controls(true);
this.modal.open();
assert.expect(2);
@ -319,6 +320,17 @@ QUnit.test('open() hides controls, close() shows controls', function(assert) {
assert.ok(this.player.controls_, 'controls are no longer hidden');
});
QUnit.test('open() hides controls, close() does not show controls if previously hidden', function(assert) {
this.player.controls(false);
this.modal.open();
assert.expect(2);
assert.notOk(this.player.controls_, 'controls are hidden');
this.modal.close();
assert.notOk(this.player.controls_, 'controls are still hidden');
});
QUnit.test('opened()', function(assert) {
const openSpy = sinon.spy();
const closeSpy = sinon.spy();