1
0
mirror of https://github.com/videojs/video.js.git synced 2025-01-19 10:54:16 +02:00

fix: async audio only tests (#7673)

This commit is contained in:
Alex Barstow 2022-03-11 12:24:50 -05:00 committed by GitHub
parent 762e7bc751
commit ebb2d09d17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2809,11 +2809,13 @@ QUnit.test('playbackRates only accepts arrays of numbers', function(assert) {
QUnit.test('audioOnlyMode can be set by option', function(assert) {
assert.expect(4);
const done = assert.async();
const player = TestHelpers.makePlayer({audioOnlyMode: true});
player.one('audioonlymodechange', () => {
assert.equal(player.audioOnlyMode(), true, 'asynchronously set via option');
assert.equal(player.hasClass('vjs-audio-only-mode'), true, 'class added asynchronously');
done();
});
assert.equal(player.audioOnlyMode(), false, 'defaults to false');
@ -2827,11 +2829,10 @@ QUnit.test('audioOnlyMode(true) returns Promise when promises are supported', fu
if (window.Promise) {
assert.ok(returnValTrue instanceof window.Promise, 'audioOnlyMode(true) returns Promise when supported');
}
return returnValTrue;
});
QUnit.test('audioOnlyMode(false) returns Promise when promises are supported', function(assert) {
const done = assert.async();
const player = TestHelpers.makePlayer({audioOnlyMode: true});
player.one('audioonlymodechange', () => {
@ -2839,9 +2840,8 @@ QUnit.test('audioOnlyMode(false) returns Promise when promises are supported', f
if (window.Promise) {
assert.ok(returnValFalse instanceof window.Promise, 'audioOnlyMode(false) returns Promise when supported');
done();
}
return returnValFalse;
});
});