Skip to content

Commit

Permalink
test that restore el is neither control el or player el
Browse files Browse the repository at this point in the history
  • Loading branch information
mister-ben committed Apr 21, 2022
1 parent 995cc28 commit f2b27b6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/unit/video.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -612,13 +612,14 @@ QUnit.test('stores placeholder el and restores on dispose', function(assert) {
const player = videojs(embed.initSelector, {restoreEl: true});

assert.ok(comparisonEl.isEqualNode(player.options_.restoreEl), `${embed.type}: restoreEl option replaced by an element`);
assert.notOk(comparisonEl.isSameNode(player.options_.restoreEl), `${embed.type}: restoreEl is a copy of the original element`);
assert.notOk(document.querySelector(embed.testSelector).isSameNode(player.options_.restoreEl), `${embed.type}: restoreEl is not the original element`);
assert.notOk(comparisonEl.isSameNode(player.options_.restoreEl), `${embed.type}: restoreEl is not the control element`);

player.dispose();

const el = document.querySelector(embed.testSelector);
const expectedEl = document.querySelector(embed.testSelector);

assert.ok(comparisonEl.isEqualNode(el), `${embed.type}: element was restored`);
assert.ok(comparisonEl.isEqualNode(expectedEl), `${embed.type}: element was restored`);

});
});

0 comments on commit f2b27b6

Please sign in to comment.