Commit 79317e6d authored by Dominique Feyer's avatar Dominique Feyer
Browse files

TASK: Make test work again after removing the sublime player markup

parent de672cad
Loading
Loading
Loading
Loading
Loading
+11 −11
Original line number Diff line number Diff line
@@ -87,26 +87,26 @@ describe("Player Core", () => {
		 * VIDEO ELEMENT SETUP TESTS
		 */

		it('detects video elements properly, including SublimeVideo markup and creates players of them.', () =>{
		it('detects video elements properly and creates players of them.', () =>{
			// Mock the DOM
			document.body.innerHTML = '<video class="player"></video><video class="sublime"></video><a class="sublime"></a><a class="player"></a>';
			document.body.innerHTML = '<video class="player"></video><a class="player"></a>';

			// Run the tests
			let res = player.initVideoElements();

			sinon.assert.calledTwice(PlayerWrapper.prototype.init);
			sinon.assert.calledOnce(PlayerWrapper.prototype.init);
		});

		it('adds launched video players to the players object', () => {
			// Mock the DOM
			document.body.innerHTML = '<video class="player"></video><video class="sublime"></video>';
			document.body.innerHTML = '<video class="player"></video>';
			// 0 before initialization
			player.players.should.be.length(0);

			let res = player.initVideoElements();

			// Holding two of them afterwards
			player.players.should.be.length(2);
			player.players.should.be.length(1);
		});
	});

@@ -116,21 +116,21 @@ describe("Player Core", () => {
		 * VIDEO ELEMENT SETUP TESTS
		 */

		it('detects lightbox elements properly, including SublimeVideo markup and prepares the triggers.', () =>{
		it('detects lightbox elements properly and prepares the triggers.', () =>{
			// Mock the DOM
			document.body.innerHTML = '<video id="test1"></video><video id="test2"></video><a class="sublime" href="#test1"></a><a class="player" href="#test2"></a>';
			document.body.innerHTML = '<video id="test1"></video><video id="test2"></video><a class="player" href="#test2"></a>';

			sinon.stub(player, 'bindLightboxTriggerEvents', () => {} );

			// Run the tests
			let res = player.prepareLightboxVideos();

			sinon.assert.calledTwice(LightboxTrigger.prototype.init);
			sinon.assert.calledTwice(player.bindLightboxTriggerEvents);
			sinon.assert.calledOnce(LightboxTrigger.prototype.init);
			sinon.assert.calledOnce(player.bindLightboxTriggerEvents);
		});

		it('passes initialized lightbox triggers to the trigger container',() => {// Mock the DOM
			document.body.innerHTML = '<video id="test1"></video><video id="test2"></video><a class="sublime" href="#test1"></a><a class="player" href="#test2"></a>';
			document.body.innerHTML = '<video id="test1"></video><video id="test2"></video><a class="player" href="#test2"></a>';

			sinon.stub(player, 'bindLightboxTriggerEvents', () => {} );
			
@@ -139,7 +139,7 @@ describe("Player Core", () => {
			// Run the tests
			let res = player.prepareLightboxVideos();

			player.lightboxtriggers.should.be.length(2);
			player.lightboxtriggers.should.be.length(1);
		});

		it('binds lightbox trigger events properly', () => {