2015-03-26 06:43:41 +02:00
|
|
|
import Button from '../../src/js/button.js';
|
|
|
|
import TestHelpers from './test-helpers.js';
|
2014-08-06 03:07:46 +03:00
|
|
|
|
2015-03-26 06:43:41 +02:00
|
|
|
q.module('Button');
|
2015-03-11 03:01:11 +02:00
|
|
|
|
2014-08-06 03:07:46 +03:00
|
|
|
test('should localize its text', function(){
|
2016-05-17 10:17:12 +02:00
|
|
|
expect(3);
|
2014-08-06 03:07:46 +03:00
|
|
|
|
|
|
|
var player, testButton, el;
|
|
|
|
|
2015-03-26 06:43:41 +02:00
|
|
|
player = TestHelpers.makePlayer({
|
2014-08-06 03:07:46 +03:00
|
|
|
'language': 'es',
|
|
|
|
'languages': {
|
|
|
|
'es': {
|
|
|
|
'Play': 'Juego'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2015-03-11 03:01:11 +02:00
|
|
|
testButton = new Button(player);
|
2015-05-30 00:56:45 +02:00
|
|
|
testButton.controlText_ = 'Play';
|
2014-08-06 03:07:46 +03:00
|
|
|
el = testButton.createEl();
|
|
|
|
|
2016-01-26 01:30:12 +02:00
|
|
|
ok(el.nodeName.toLowerCase().match('button'));
|
2016-05-19 09:47:27 +02:00
|
|
|
ok(el.innerHTML.match(/vjs-control-text"?>Juego/));
|
2016-05-17 10:17:12 +02:00
|
|
|
equal(el.getAttribute('title'), 'Juego');
|
2014-08-06 03:07:46 +03:00
|
|
|
});
|