Skip to content

Commit

Permalink
fix assert.equal/assert.ok in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
harisha-swaminathan committed Mar 15, 2022
1 parent b7e4e4e commit 6edb802
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions test/unit/player.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1583,7 +1583,7 @@ QUnit.test('default audioPosterMode value at player creation', function(assert)

player2.trigger('ready');
player2.one('audiopostermodechange', () => {
assert.ok(player2.audioPosterMode() === true, 'audioPosterMode can be set to true when the player is created');
assert.ok(player2.audioPosterMode(), 'audioPosterMode can be set to true when the player is created');
done();
});
});
Expand All @@ -1593,7 +1593,7 @@ QUnit.test('get and set audioPosterMode value', function(assert) {

return player.audioPosterMode(true)
.then(() => {
assert.equal(player.audioPosterMode(), true, 'audioPosterMode is set to true');
assert.ok(player.audioPosterMode(), 'audioPosterMode is set to true');
});
});

Expand Down Expand Up @@ -1621,7 +1621,7 @@ QUnit.test('setting audioPosterMode() should trigger audiopostermodechange event
player.trigger('ready');
player.one('audiopostermodechange', () => {
assert.ok(true, 'audiopostermodechange event was triggered');
assert.equal(player.audioPosterMode(), true, 'audioPosterMode is set to true');
assert.ok(player.audioPosterMode(), 'audioPosterMode is set to true');
done();
});
});
Expand Down Expand Up @@ -3120,8 +3120,8 @@ QUnit.test('setting both audioOnlyMode and audioPosterMode options to true will
player.trigger('ready');

player.one('audioonlymodechange', () => {
assert.ok(player.audioOnlyMode() === true, 'audioOnlyMode is true');
assert.ok(player.audioPosterMode() === false, 'audioPosterMode is false');
assert.ok(player.audioOnlyMode(), 'audioOnlyMode is true');
assert.notOk(player.audioPosterMode(), 'audioPosterMode is false');
done();
});
});
Expand All @@ -3130,23 +3130,23 @@ QUnit.test('turning on audioOnlyMode when audioPosterMode is already on will tur
const player = TestHelpers.makePlayer({audioPosterMode: true});

player.trigger('ready');
assert.ok(player.audioPosterMode() === true, 'audioPosterMode is true');
assert.ok(player.audioPosterMode(), 'audioPosterMode is true');
return player.audioOnlyMode(true)
.then(() => {
assert.ok(player.audioPosterMode() === false, 'audioPosterMode is false');
assert.ok(player.audioOnlyMode() === true, 'audioOnlyMode is true');
assert.notOk(player.audioPosterMode(), 'audioPosterMode is false');
assert.ok(player.audioOnlyMode(), 'audioOnlyMode is true');
});
});

QUnit.test('turning on audioPosterMode when audioOnlyMode is already on will turn off audioOnlyMode', function(assert) {
const player = TestHelpers.makePlayer({audioOnlyMode: true});

player.trigger('ready');
assert.ok(player.audioOnlyMode() === true, 'audioOnlyMode is true');
assert.ok(player.audioOnlyMode(), 'audioOnlyMode is true');
return player.audioPosterMode(true)
.then(() => {
assert.equal(player.audioPosterMode(), true, 'audioPosterMode is true');
assert.equal(player.audioOnlyMode(), false, 'audioOnlyMode is false');
assert.ok(player.audioPosterMode(), 'audioPosterMode is true');
assert.notOk(player.audioOnlyMode(), 'audioOnlyMode is false');
});
});

0 comments on commit 6edb802

Please sign in to comment.