1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-23 02:04:34 +02:00
video.js/test/unit/tracks/track.test.js
2016-08-05 11:37:12 -04:00

35 lines
853 B
JavaScript

/* eslint-env qunit */
import TechFaker from '../tech/tech-faker';
import TrackBaseline from './track-baseline';
import Track from '../../../src/js/tracks/track.js';
const defaultTech = {
textTracks() {},
on() {},
off() {},
currentTime() {}
};
// do baseline track testing
QUnit.module('Track');
TrackBaseline(Track, {
id: '1',
kind: 'subtitles',
mode: 'disabled',
label: 'English',
language: 'en',
tech: new TechFaker()
});
QUnit.test('defaults when items not provided', function() {
const track = new Track({
tech: defaultTech
});
QUnit.equal(track.kind, '', 'kind defaulted to empty string');
QUnit.equal(track.label, '', 'label defaults to empty string');
QUnit.equal(track.language, '', 'language defaults to empty string');
QUnit.ok(track.id.match(/vjs_track_\d{5}/), 'id defaults to vjs_track_GUID');
});