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