1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-14 11:23:30 +02:00
video.js/test/unit/button.test.js

28 lines
629 B
JavaScript
Raw Normal View History

/* eslint-env qunit */
import Button from '../../src/js/button.js';
import TestHelpers from './test-helpers.js';
QUnit.module('Button');
QUnit.test('should localize its text', function() {
QUnit.expect(3);
const player = TestHelpers.makePlayer({
language: 'es',
languages: {
es: {
Play: 'Juego'
}
}
});
const testButton = new Button(player);
testButton.controlText_ = 'Play';
const el = testButton.createEl();
QUnit.ok(el.nodeName.toLowerCase().match('button'));
QUnit.ok(el.innerHTML.match(/vjs-control-text"?>Juego/));
QUnit.equal(el.getAttribute('title'), 'Juego');
});