2016-08-03 15:27:03 -04:00
|
|
|
/* eslint-env qunit */
|
2015-03-25 21:43:41 -07:00
|
|
|
import TestHelpers from './test-helpers.js';
|
|
|
|
|
2016-08-03 15:27:03 -04:00
|
|
|
QUnit.module('Setup');
|
2014-09-29 16:13:07 -07:00
|
|
|
|
2016-08-12 13:51:31 -04:00
|
|
|
QUnit.test('should set options from data-setup even if autoSetup is not called before initialisation', function(assert) {
|
2016-08-03 15:27:03 -04:00
|
|
|
const el = TestHelpers.makeTag();
|
2014-09-29 16:13:07 -07:00
|
|
|
|
2018-09-28 14:58:15 -04:00
|
|
|
el.setAttribute(
|
|
|
|
'data-setup',
|
|
|
|
'{"controls": true, "autoplay": false, "preload": "auto", "playsinline": true}'
|
|
|
|
);
|
2014-09-29 16:13:07 -07:00
|
|
|
|
2016-08-03 15:27:03 -04:00
|
|
|
const player = TestHelpers.makePlayer({}, el);
|
|
|
|
|
2016-08-12 13:51:31 -04:00
|
|
|
assert.ok(player.options_.controls === true);
|
|
|
|
assert.ok(player.options_.autoplay === false);
|
|
|
|
assert.ok(player.options_.preload === 'auto');
|
2017-05-12 16:39:37 -04:00
|
|
|
assert.ok(player.options_.playsinline === true);
|
2016-08-25 10:58:42 -04:00
|
|
|
player.dispose();
|
2014-09-29 16:13:07 -07:00
|
|
|
});
|