Skip to content

Commit

Permalink
test: fix modal dialog test for showing controls (#4707)
Browse files Browse the repository at this point in the history
Also, add a test that verifies the behavior for the PR (#4690).

Fixes #4706.
  • Loading branch information
gkatsev authored Oct 31, 2017
1 parent 7963913 commit 45a6b30
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions test/unit/modal-dialog.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
Expand Down

0 comments on commit 45a6b30

Please sign in to comment.