Skip to content

Commit

Permalink
test(playback-core): Account for browser-specific cases where they pr… (
Browse files Browse the repository at this point in the history
#866)

…ovide their own default error message in our error tests.
  • Loading branch information
cjpillsbury authored Feb 6, 2024
1 parent ffe71b9 commit 91dc743
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/playback-core/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ describe('playback core', function () {
await new Promise((resolve) => video.addEventListener('error', resolve));

assert.equal(video.error.code, MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED);
assert.equal(video.error.message, '');
assert(video.error.message != undefined, 'has some message');

assert.equal(getError(video).code, MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED);
assert.equal(
getError(video).message,
'An unsupported error occurred. The server or network failed, or your browser does not support this format.'
);
const expectedMessage = !!video.error.message
? video.error.message
: MediaError.defaultMessages[MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED];
assert.equal(getError(video).message, expectedMessage);
});

it('setAutoplay("any")', async function () {
Expand Down

0 comments on commit 91dc743

Please sign in to comment.