1
0
mirror of https://github.com/videojs/video.js.git synced 2025-01-10 23:30:03 +02:00
video.js/test/unit/button.test.js
Gary Katsevman 9ceb4e4fe0
feat: playerresize event in all cases (#4864)
Use ResizeObserver when available for better and more performant resizing information, otherwise, fall back to a throttled resize event on an iframe that's the size of the player.
Allows a video.js user to disable this by setting resizeManager: false as an option since the component will not be initialized.

Add a debounce util.

This reverts #4800 (e0ed0b5) because we end up getting two playerresize events with the dimension methods now.
2018-01-30 13:26:21 -05:00

31 lines
684 B
JavaScript

/* 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(assert) {
assert.expect(3);
const player = TestHelpers.makePlayer({
language: 'es',
languages: {
es: {
Play: 'Juego'
}
}
});
const testButton = new Button(player);
testButton.controlText_ = 'Play';
const el = testButton.createEl();
assert.ok(el.nodeName.toLowerCase().match('button'));
assert.ok(el.innerHTML.match(/vjs-control-text"?>Juego/));
assert.equal(el.getAttribute('title'), 'Juego');
testButton.dispose();
player.dispose();
});