From 45a6b3010df2a551146ae534322dec3e1b3714b0 Mon Sep 17 00:00:00 2001 From: Gary Katsevman Date: Tue, 31 Oct 2017 11:35:01 -0400 Subject: [PATCH] test: fix modal dialog test for showing controls (#4707) Also, add a test that verifies the behavior for the PR (#4690). Fixes #4706. --- test/unit/modal-dialog.test.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/test/unit/modal-dialog.test.js b/test/unit/modal-dialog.test.js index 15b25a161..02f5cd056 100644 --- a/test/unit/modal-dialog.test.js +++ b/test/unit/modal-dialog.test.js @@ -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();