1
0
mirror of https://github.com/videojs/video.js.git synced 2025-01-02 06:32:07 +02:00

fix(tests): Skip a test on old Safari (#8356)

This commit is contained in:
mister-ben 2023-07-19 09:10:07 +02:00 committed by GitHub
parent c66bf4023f
commit 452a918a42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,9 @@
/* eslint-env qunit */
import document from 'global/document';
import window from 'global/window';
import sinon from 'sinon';
import * as Dom from '../../../src/js/utils/dom.js';
import { IS_SAFARI } from '../../../src/js/utils/browser.js';
import TestHelpers from '../test-helpers.js';
QUnit.module('utils/dom');
@ -687,7 +689,11 @@ QUnit.test('isSingleLeftClick() checks return values for mousedown event', funct
assert.ok(Dom.isSingleLeftClick(mouseEvent), 'a touch event on simulated mobiles is a single left click');
});
QUnit.test('Dom.copyStyleSheetsToWindow() copies all style sheets to a window', function(assert) {
// The next test is skipped on Safari < 14, which has a broken document.styleSheets
// copyStyleSheetsToWindow() is only used on browsers supporting documentPictureInPicture - Chromium 113+
const skipOnOldSafari = IS_SAFARI && parseInt(window.navigator.userAgent.match(/Version\/(\d+)\./)[1], 10) < 14 ? 'skip' : 'test';
QUnit[skipOnOldSafari]('Dom.copyStyleSheetsToWindow() copies all style sheets to a window', function(assert) {
const fakeWindow = document.createElement('div');
const done = assert.async();