2016-08-03 21:27:47 +02:00
|
|
|
/* eslint-env qunit */
|
2015-03-26 06:43:41 +02:00
|
|
|
import TextTrackSettings from '../../../src/js/tracks/text-track-settings.js';
|
|
|
|
import TestHelpers from '../test-helpers.js';
|
2015-05-04 01:12:38 +02:00
|
|
|
import * as Events from '../../../src/js/utils/events.js';
|
2018-03-13 18:03:39 +02:00
|
|
|
import sinon from 'sinon';
|
2015-03-26 06:43:41 +02:00
|
|
|
import window from 'global/window';
|
2017-03-02 22:22:59 +02:00
|
|
|
import Component from '../../../src/js/component.js';
|
2023-04-04 22:54:36 +02:00
|
|
|
import videojs from '../../../src/js/video.js';
|
2015-02-14 01:18:07 +02:00
|
|
|
|
2016-03-07 21:54:32 +02:00
|
|
|
const tracks = [{
|
2015-02-14 01:18:07 +02:00
|
|
|
kind: 'captions',
|
|
|
|
label: 'test'
|
|
|
|
}];
|
|
|
|
|
2016-07-19 06:19:36 +02:00
|
|
|
const defaultSettings = {
|
2016-08-03 21:27:47 +02:00
|
|
|
backgroundColor: '#000',
|
|
|
|
backgroundOpacity: '1',
|
|
|
|
color: '#FFF',
|
|
|
|
fontFamily: 'proportionalSansSerif',
|
|
|
|
textOpacity: '1',
|
|
|
|
windowColor: '#000',
|
|
|
|
windowOpacity: '0'
|
2016-07-19 06:19:36 +02:00
|
|
|
};
|
|
|
|
|
2016-08-03 21:27:47 +02:00
|
|
|
QUnit.module('Text Track Settings', {
|
2016-03-07 21:54:32 +02:00
|
|
|
beforeEach() {
|
2015-03-26 06:43:41 +02:00
|
|
|
window.localStorage.clear();
|
2017-03-02 22:22:59 +02:00
|
|
|
this.oldComponentFocus = Component.prototype.focus;
|
|
|
|
this.oldComponentBlur = Component.prototype.blur;
|
|
|
|
Component.prototype.focus = function() {};
|
|
|
|
Component.prototype.blur = function() {};
|
|
|
|
},
|
|
|
|
afterEach() {
|
|
|
|
Component.prototype.focus = this.oldComponentFocus;
|
|
|
|
Component.prototype.blur = this.oldComponentBlur;
|
2015-03-26 06:43:41 +02:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2016-08-12 19:51:31 +02:00
|
|
|
QUnit.test('should update settings', function(assert) {
|
2016-08-03 21:27:47 +02:00
|
|
|
const player = TestHelpers.makePlayer({
|
2016-03-07 21:54:32 +02:00
|
|
|
tracks,
|
|
|
|
persistTextTrackSettings: true
|
|
|
|
});
|
2016-11-04 19:45:51 +02:00
|
|
|
|
2016-07-19 06:19:36 +02:00
|
|
|
const newSettings = {
|
|
|
|
backgroundOpacity: '0.5',
|
|
|
|
textOpacity: '0.5',
|
|
|
|
windowOpacity: '0.5',
|
2016-03-07 21:54:32 +02:00
|
|
|
edgeStyle: 'raised',
|
|
|
|
fontFamily: 'monospaceSerif',
|
2016-07-19 06:19:36 +02:00
|
|
|
color: '#F00',
|
2016-03-07 21:54:32 +02:00
|
|
|
backgroundColor: '#FFF',
|
|
|
|
windowColor: '#FFF',
|
|
|
|
fontPercent: 1.25
|
|
|
|
};
|
2015-02-14 01:18:07 +02:00
|
|
|
|
|
|
|
player.textTrackSettings.setValues(newSettings);
|
2016-11-04 19:45:51 +02:00
|
|
|
|
2018-09-28 20:58:15 +02:00
|
|
|
assert.deepEqual(
|
|
|
|
player.textTrackSettings.getValues(),
|
|
|
|
newSettings,
|
|
|
|
'values are updated'
|
|
|
|
);
|
|
|
|
|
|
|
|
assert.equal(
|
2023-02-06 21:44:24 +02:00
|
|
|
player.$('.vjs-text-color > select').selectedIndex,
|
2018-09-28 20:58:15 +02:00
|
|
|
2,
|
2023-02-06 21:44:24 +02:00
|
|
|
'text-color is set to new value'
|
2018-09-28 20:58:15 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
assert.equal(
|
|
|
|
player.$('.vjs-bg-color > select').selectedIndex,
|
|
|
|
1,
|
|
|
|
'bg-color is set to new value'
|
|
|
|
);
|
|
|
|
|
|
|
|
assert.equal(
|
|
|
|
player.$('.vjs-window-color > select').selectedIndex,
|
|
|
|
1,
|
|
|
|
'window-color is set to new value'
|
|
|
|
);
|
|
|
|
|
|
|
|
assert.equal(
|
|
|
|
player.$('.vjs-text-opacity > select').selectedIndex,
|
|
|
|
1,
|
|
|
|
'text-opacity is set to new value'
|
|
|
|
);
|
|
|
|
|
|
|
|
assert.equal(
|
|
|
|
player.$('.vjs-bg-opacity > select').selectedIndex,
|
|
|
|
1,
|
|
|
|
'bg-opacity is set to new value'
|
|
|
|
);
|
|
|
|
|
|
|
|
assert.equal(
|
|
|
|
player.$('.vjs-window-opacity > select').selectedIndex,
|
|
|
|
1,
|
|
|
|
'window-opacity is set to new value'
|
|
|
|
);
|
|
|
|
|
|
|
|
assert.equal(
|
|
|
|
player.$('.vjs-edge-style select').selectedIndex,
|
|
|
|
1,
|
|
|
|
'edge-style is set to new value'
|
|
|
|
);
|
|
|
|
|
|
|
|
assert.equal(
|
|
|
|
player.$('.vjs-font-family select').selectedIndex,
|
|
|
|
3,
|
|
|
|
'font-family is set to new value'
|
|
|
|
);
|
|
|
|
|
|
|
|
assert.equal(
|
|
|
|
player.$('.vjs-font-percent select').selectedIndex,
|
|
|
|
3,
|
|
|
|
'font-percent is set to new value'
|
|
|
|
);
|
2015-11-10 00:43:17 +02:00
|
|
|
|
|
|
|
Events.trigger(player.$('.vjs-done-button'), 'click');
|
2016-11-04 19:45:51 +02:00
|
|
|
|
2018-09-28 20:58:15 +02:00
|
|
|
assert.deepEqual(
|
2024-08-11 08:21:10 +02:00
|
|
|
JSON.parse(window.localStorage.getItem('vjs-text-track-settings')),
|
2018-09-28 20:58:15 +02:00
|
|
|
newSettings,
|
|
|
|
'values are saved'
|
|
|
|
);
|
2015-08-25 02:46:54 +02:00
|
|
|
|
|
|
|
player.dispose();
|
2015-02-14 01:18:07 +02:00
|
|
|
});
|
|
|
|
|
2016-08-12 19:51:31 +02:00
|
|
|
QUnit.test('should restore default settings', function(assert) {
|
2016-08-03 21:27:47 +02:00
|
|
|
const player = TestHelpers.makePlayer({
|
2016-03-07 21:54:32 +02:00
|
|
|
tracks,
|
2015-02-14 01:18:07 +02:00
|
|
|
persistTextTrackSettings: true
|
|
|
|
});
|
|
|
|
|
2023-02-06 21:44:24 +02:00
|
|
|
player.$('.vjs-text-color > select').selectedIndex = 1;
|
2015-11-10 00:43:17 +02:00
|
|
|
player.$('.vjs-bg-color > select').selectedIndex = 1;
|
2016-11-04 19:45:51 +02:00
|
|
|
player.$('.vjs-window-color > select').selectedIndex = 1;
|
2015-11-10 00:43:17 +02:00
|
|
|
player.$('.vjs-text-opacity > select').selectedIndex = 1;
|
|
|
|
player.$('.vjs-bg-opacity > select').selectedIndex = 1;
|
|
|
|
player.$('.vjs-window-opacity > select').selectedIndex = 1;
|
|
|
|
player.$('.vjs-edge-style select').selectedIndex = 1;
|
|
|
|
player.$('.vjs-font-family select').selectedIndex = 1;
|
|
|
|
player.$('.vjs-font-percent select').selectedIndex = 3;
|
2015-02-14 01:18:07 +02:00
|
|
|
|
2015-11-10 00:43:17 +02:00
|
|
|
Events.trigger(player.$('.vjs-done-button'), 'click');
|
|
|
|
Events.trigger(player.$('.vjs-default-button'), 'click');
|
|
|
|
Events.trigger(player.$('.vjs-done-button'), 'click');
|
2015-02-14 01:18:07 +02:00
|
|
|
|
2018-09-28 20:58:15 +02:00
|
|
|
assert.deepEqual(
|
|
|
|
player.textTrackSettings.getValues(),
|
|
|
|
defaultSettings,
|
|
|
|
'values are defaulted'
|
|
|
|
);
|
2016-08-03 21:27:47 +02:00
|
|
|
// TODO:
|
|
|
|
// MikeA: need to figure out how to modify saveSettings
|
|
|
|
// to factor in defaults are no longer null
|
2016-08-12 19:51:31 +02:00
|
|
|
// assert.deepEqual(window.localStorage.getItem('vjs-text-track-settings'),
|
2016-08-03 21:27:47 +02:00
|
|
|
// defaultSettings,
|
|
|
|
// 'values are saved');
|
|
|
|
|
2018-09-28 20:58:15 +02:00
|
|
|
assert.equal(
|
2023-02-06 21:44:24 +02:00
|
|
|
player.$('.vjs-text-color > select').selectedIndex,
|
2018-09-28 20:58:15 +02:00
|
|
|
0,
|
2023-02-06 21:44:24 +02:00
|
|
|
'text-color is set to default value'
|
2018-09-28 20:58:15 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
assert.equal(
|
|
|
|
player.$('.vjs-bg-color > select').selectedIndex,
|
|
|
|
0,
|
|
|
|
'bg-color is set to default value'
|
|
|
|
);
|
|
|
|
|
|
|
|
assert.equal(
|
|
|
|
player.$('.vjs-window-color > select').selectedIndex,
|
|
|
|
0,
|
|
|
|
'window-color is set to default value'
|
|
|
|
);
|
|
|
|
|
|
|
|
assert.equal(
|
|
|
|
player.$('.vjs-text-opacity > select').selectedIndex,
|
|
|
|
0,
|
|
|
|
'text-opacity is set to default value'
|
|
|
|
);
|
|
|
|
|
|
|
|
assert.equal(
|
|
|
|
player.$('.vjs-bg-opacity > select').selectedIndex,
|
|
|
|
0,
|
|
|
|
'bg-opacity is set to default value'
|
|
|
|
);
|
|
|
|
|
|
|
|
assert.equal(
|
|
|
|
player.$('.vjs-window-opacity > select').selectedIndex,
|
|
|
|
0,
|
|
|
|
'window-opacity is set to default value'
|
|
|
|
);
|
|
|
|
|
|
|
|
assert.equal(
|
|
|
|
player.$('.vjs-edge-style select').selectedIndex,
|
|
|
|
0,
|
|
|
|
'edge-style is set to default value'
|
|
|
|
);
|
|
|
|
|
|
|
|
assert.equal(
|
|
|
|
player.$('.vjs-font-family select').selectedIndex,
|
|
|
|
0,
|
|
|
|
'font-family is set to default value'
|
|
|
|
);
|
|
|
|
|
|
|
|
assert.equal(
|
|
|
|
player.$('.vjs-font-percent select').selectedIndex,
|
|
|
|
2,
|
|
|
|
'font-percent is set to default value'
|
|
|
|
);
|
2015-08-25 02:46:54 +02:00
|
|
|
|
|
|
|
player.dispose();
|
2015-02-14 01:18:07 +02:00
|
|
|
});
|
|
|
|
|
2016-08-12 19:51:31 +02:00
|
|
|
QUnit.test('should open on click', function(assert) {
|
2018-03-13 18:03:39 +02:00
|
|
|
const clock = sinon.useFakeTimers();
|
2016-08-03 21:27:47 +02:00
|
|
|
const player = TestHelpers.makePlayer({
|
2016-03-07 21:54:32 +02:00
|
|
|
tracks
|
2015-02-14 01:18:07 +02:00
|
|
|
});
|
2016-03-07 21:54:32 +02:00
|
|
|
|
2018-03-13 18:03:39 +02:00
|
|
|
clock.tick(1);
|
|
|
|
|
2015-11-10 00:43:17 +02:00
|
|
|
Events.trigger(player.$('.vjs-texttrack-settings'), 'click');
|
2016-08-12 19:51:31 +02:00
|
|
|
assert.ok(!player.textTrackSettings.hasClass('vjs-hidden'), 'settings open');
|
2015-08-25 02:46:54 +02:00
|
|
|
|
|
|
|
player.dispose();
|
2018-03-13 18:03:39 +02:00
|
|
|
clock.restore();
|
2015-02-14 01:18:07 +02:00
|
|
|
});
|
|
|
|
|
2016-08-12 19:51:31 +02:00
|
|
|
QUnit.test('should close on done click', function(assert) {
|
2018-03-13 18:03:39 +02:00
|
|
|
const clock = sinon.useFakeTimers();
|
2016-08-03 21:27:47 +02:00
|
|
|
const player = TestHelpers.makePlayer({
|
2016-03-07 21:54:32 +02:00
|
|
|
tracks
|
2015-02-14 01:18:07 +02:00
|
|
|
});
|
2016-03-07 21:54:32 +02:00
|
|
|
|
2018-03-13 18:03:39 +02:00
|
|
|
clock.tick(1);
|
|
|
|
|
2015-11-10 00:43:17 +02:00
|
|
|
Events.trigger(player.$('.vjs-texttrack-settings'), 'click');
|
|
|
|
Events.trigger(player.$('.vjs-done-button'), 'click');
|
2016-08-12 19:51:31 +02:00
|
|
|
assert.ok(player.textTrackSettings.hasClass('vjs-hidden'), 'settings closed');
|
2015-08-25 02:46:54 +02:00
|
|
|
|
|
|
|
player.dispose();
|
2018-03-13 18:03:39 +02:00
|
|
|
clock.restore();
|
2015-02-14 01:18:07 +02:00
|
|
|
});
|
|
|
|
|
2016-08-12 19:51:31 +02:00
|
|
|
QUnit.test('if persist option is set, restore settings on init', function(assert) {
|
2016-08-03 21:27:47 +02:00
|
|
|
const oldRestoreSettings = TextTrackSettings.prototype.restoreSettings;
|
2016-03-07 21:54:32 +02:00
|
|
|
let restore = 0;
|
2015-02-14 01:18:07 +02:00
|
|
|
|
2015-03-26 06:43:41 +02:00
|
|
|
TextTrackSettings.prototype.restoreSettings = function() {
|
2015-02-14 01:18:07 +02:00
|
|
|
restore++;
|
|
|
|
};
|
|
|
|
|
2016-08-03 21:27:47 +02:00
|
|
|
const player = TestHelpers.makePlayer({
|
2016-03-07 21:54:32 +02:00
|
|
|
tracks,
|
2015-02-14 01:18:07 +02:00
|
|
|
persistTextTrackSettings: true
|
|
|
|
});
|
|
|
|
|
2016-08-12 19:51:31 +02:00
|
|
|
assert.equal(restore, 1, 'restore was called');
|
2015-02-14 01:18:07 +02:00
|
|
|
|
2015-03-26 06:43:41 +02:00
|
|
|
TextTrackSettings.prototype.restoreSettings = oldRestoreSettings;
|
2015-08-25 02:46:54 +02:00
|
|
|
|
|
|
|
player.dispose();
|
2015-02-14 01:18:07 +02:00
|
|
|
});
|
|
|
|
|
2016-08-12 19:51:31 +02:00
|
|
|
QUnit.test('if persist option is set, save settings when "done"', function(assert) {
|
2016-08-03 21:27:47 +02:00
|
|
|
const player = TestHelpers.makePlayer({
|
2016-03-07 21:54:32 +02:00
|
|
|
tracks,
|
|
|
|
persistTextTrackSettings: true
|
|
|
|
});
|
2017-03-02 22:22:59 +02:00
|
|
|
|
2016-08-03 21:27:47 +02:00
|
|
|
const oldSaveSettings = TextTrackSettings.prototype.saveSettings;
|
2016-03-07 21:54:32 +02:00
|
|
|
let save = 0;
|
2015-02-14 01:18:07 +02:00
|
|
|
|
2015-03-26 06:43:41 +02:00
|
|
|
TextTrackSettings.prototype.saveSettings = function() {
|
2015-02-14 01:18:07 +02:00
|
|
|
save++;
|
|
|
|
};
|
|
|
|
|
2015-11-10 00:43:17 +02:00
|
|
|
Events.trigger(player.$('.vjs-done-button'), 'click');
|
2015-02-14 01:18:07 +02:00
|
|
|
|
2016-08-12 19:51:31 +02:00
|
|
|
assert.equal(save, 1, 'save was called');
|
2015-02-14 01:18:07 +02:00
|
|
|
|
2015-03-26 06:43:41 +02:00
|
|
|
TextTrackSettings.prototype.saveSettings = oldSaveSettings;
|
2015-08-25 02:46:54 +02:00
|
|
|
|
|
|
|
player.dispose();
|
2015-02-14 01:18:07 +02:00
|
|
|
});
|
|
|
|
|
2016-08-12 19:51:31 +02:00
|
|
|
QUnit.test('do not try to restore or save settings if persist option is not set', function(assert) {
|
2016-08-03 21:27:47 +02:00
|
|
|
const oldRestoreSettings = TextTrackSettings.prototype.restoreSettings;
|
|
|
|
const oldSaveSettings = TextTrackSettings.prototype.saveSettings;
|
2016-03-07 21:54:32 +02:00
|
|
|
let save = 0;
|
|
|
|
let restore = 0;
|
2015-02-14 01:18:07 +02:00
|
|
|
|
2015-03-26 06:43:41 +02:00
|
|
|
TextTrackSettings.prototype.restoreSettings = function() {
|
2015-02-14 01:18:07 +02:00
|
|
|
restore++;
|
|
|
|
};
|
2015-03-26 06:43:41 +02:00
|
|
|
TextTrackSettings.prototype.saveSettings = function() {
|
2015-02-14 01:18:07 +02:00
|
|
|
save++;
|
|
|
|
};
|
|
|
|
|
2016-08-03 21:27:47 +02:00
|
|
|
const player = TestHelpers.makePlayer({
|
2016-03-07 21:54:32 +02:00
|
|
|
tracks,
|
2015-02-14 01:18:07 +02:00
|
|
|
persistTextTrackSettings: false
|
|
|
|
});
|
|
|
|
|
2016-08-12 19:51:31 +02:00
|
|
|
assert.equal(restore, 0, 'restore was not called');
|
2015-02-14 01:18:07 +02:00
|
|
|
|
2015-11-10 00:43:17 +02:00
|
|
|
Events.trigger(player.$('.vjs-done-button'), 'click');
|
2015-02-14 01:18:07 +02:00
|
|
|
|
|
|
|
// saveSettings is called but does nothing
|
2016-08-12 19:51:31 +02:00
|
|
|
assert.equal(save, 1, 'save was not called');
|
2015-02-14 01:18:07 +02:00
|
|
|
|
2015-03-26 06:43:41 +02:00
|
|
|
TextTrackSettings.prototype.saveSettings = oldSaveSettings;
|
|
|
|
TextTrackSettings.prototype.restoreSettings = oldRestoreSettings;
|
2015-08-25 02:46:54 +02:00
|
|
|
|
|
|
|
player.dispose();
|
2015-02-14 01:18:07 +02:00
|
|
|
});
|
|
|
|
|
2016-08-12 19:51:31 +02:00
|
|
|
QUnit.test('should restore saved settings', function(assert) {
|
2016-07-19 06:19:36 +02:00
|
|
|
const newSettings = {
|
|
|
|
backgroundOpacity: '0.5',
|
|
|
|
textOpacity: '0.5',
|
|
|
|
windowOpacity: '0.5',
|
2016-03-07 21:54:32 +02:00
|
|
|
edgeStyle: 'raised',
|
|
|
|
fontFamily: 'monospaceSerif',
|
2016-07-19 06:19:36 +02:00
|
|
|
color: '#F00',
|
2016-03-07 21:54:32 +02:00
|
|
|
backgroundColor: '#FFF',
|
|
|
|
windowColor: '#FFF',
|
|
|
|
fontPercent: 1.25
|
|
|
|
};
|
2015-02-14 01:18:07 +02:00
|
|
|
|
|
|
|
window.localStorage.setItem('vjs-text-track-settings', JSON.stringify(newSettings));
|
|
|
|
|
2016-08-03 21:27:47 +02:00
|
|
|
const player = TestHelpers.makePlayer({
|
2016-03-07 21:54:32 +02:00
|
|
|
tracks,
|
2015-02-14 01:18:07 +02:00
|
|
|
persistTextTrackSettings: true
|
|
|
|
});
|
|
|
|
|
2016-08-12 19:51:31 +02:00
|
|
|
assert.deepEqual(player.textTrackSettings.getValues(), newSettings);
|
2015-08-25 02:46:54 +02:00
|
|
|
|
|
|
|
player.dispose();
|
2015-02-14 01:18:07 +02:00
|
|
|
});
|
|
|
|
|
2016-08-12 19:51:31 +02:00
|
|
|
QUnit.test('should not restore saved settings', function(assert) {
|
2016-07-19 06:19:36 +02:00
|
|
|
const newSettings = {
|
|
|
|
backgroundOpacity: '0.5',
|
|
|
|
textOpacity: '0.5',
|
|
|
|
windowOpacity: '0.5',
|
2016-03-07 21:54:32 +02:00
|
|
|
edgeStyle: 'raised',
|
|
|
|
fontFamily: 'monospaceSerif',
|
2016-07-19 06:19:36 +02:00
|
|
|
color: '#F00',
|
2016-03-07 21:54:32 +02:00
|
|
|
backgroundColor: '#FFF',
|
|
|
|
windowColor: '#FFF',
|
|
|
|
fontPercent: 1.25
|
|
|
|
};
|
2015-02-14 01:18:07 +02:00
|
|
|
|
|
|
|
window.localStorage.setItem('vjs-text-track-settings', JSON.stringify(newSettings));
|
|
|
|
|
2016-08-03 21:27:47 +02:00
|
|
|
const player = TestHelpers.makePlayer({
|
2016-03-07 21:54:32 +02:00
|
|
|
tracks,
|
2015-02-14 01:18:07 +02:00
|
|
|
persistTextTrackSettings: false
|
|
|
|
});
|
|
|
|
|
2016-08-12 19:51:31 +02:00
|
|
|
assert.deepEqual(player.textTrackSettings.getValues(), defaultSettings);
|
2015-08-25 02:46:54 +02:00
|
|
|
|
|
|
|
player.dispose();
|
2015-02-14 01:18:07 +02:00
|
|
|
});
|
2023-04-04 22:54:36 +02:00
|
|
|
|
|
|
|
QUnit.test('should update on languagechange', function(assert) {
|
|
|
|
const player = TestHelpers.makePlayer({
|
|
|
|
tracks
|
|
|
|
});
|
|
|
|
|
|
|
|
videojs.addLanguage('test', {'Font Size': 'FONTSIZE'});
|
|
|
|
player.language('test');
|
|
|
|
|
|
|
|
assert.equal(player.$('.vjs-font-percent legend').textContent, 'FONTSIZE', 'settings dialog updates on languagechange');
|
|
|
|
|
|
|
|
player.dispose();
|
|
|
|
});
|
2024-01-16 18:43:39 +02:00
|
|
|
|
|
|
|
QUnit.test('should associate <label>s with <select>s', function(assert) {
|
|
|
|
const player = TestHelpers.makePlayer({
|
|
|
|
tracks
|
|
|
|
});
|
|
|
|
|
|
|
|
const firstLabelFor = player.textTrackSettings.el_.querySelector('label').getAttribute('for');
|
|
|
|
|
|
|
|
assert.ok(
|
|
|
|
videojs.dom.isEl(player.textTrackSettings.el_.querySelector(`#${firstLabelFor}`)),
|
|
|
|
'label has a `for` attribute matching an `id`'
|
|
|
|
);
|
|
|
|
|
|
|
|
});
|
2024-06-01 23:11:52 +02:00
|
|
|
|
|
|
|
QUnit.test('should not duplicate ids', function(assert) {
|
|
|
|
const player = TestHelpers.makePlayer({
|
|
|
|
tracks
|
|
|
|
});
|
|
|
|
|
|
|
|
const elements = [...player.el().querySelectorAll('[id]')];
|
|
|
|
const ids = elements.map(el => el.id);
|
|
|
|
const duplicates = elements.filter(el => ids.filter(id => id === el.id).length > 1);
|
|
|
|
|
|
|
|
assert.strictEqual(duplicates.length, 0, 'there should be no duplicate ids');
|
|
|
|
});
|