area-51/lib/video.js-main/test/unit/setup.test.js
2025-01-30 04:21:55 +01:00

21 lines
650 B
JavaScript

/* eslint-env qunit */
import TestHelpers from './test-helpers.js';
QUnit.module('Setup');
QUnit.test('should set options from data-setup even if autoSetup is not called before initialisation', function(assert) {
const el = TestHelpers.makeTag();
el.setAttribute(
'data-setup',
'{"controls": true, "autoplay": false, "preload": "auto", "playsinline": true}'
);
const player = TestHelpers.makePlayer({}, el);
assert.ok(player.options_.controls === true);
assert.ok(player.options_.autoplay === false);
assert.ok(player.options_.preload === 'auto');
assert.ok(player.options_.playsinline === true);
player.dispose();
});