mirror of
https://github.com/videojs/video.js.git
synced 2025-04-09 07:23:57 +02:00
Update tests
Check for the presence of `vjs-disabled` instead of whether the display is set to none for volume and mute control tests.
This commit is contained in:
parent
e55e5a7313
commit
cf52750a57
36
test/unit/controls.js
vendored
36
test/unit/controls.js
vendored
@ -1,6 +1,6 @@
|
||||
module('Controls');
|
||||
|
||||
test('should hide volume control if it\'s not supported', function() {
|
||||
test('should hide volume control if it\'s not supported', function(){
|
||||
var noop, player, volumeControl, muteToggle;
|
||||
noop = function(){};
|
||||
player = {
|
||||
@ -16,8 +16,8 @@ test('should hide volume control if it\'s not supported', function() {
|
||||
volumeControl = new vjs.VolumeControl(player);
|
||||
muteToggle = new vjs.MuteToggle(player);
|
||||
|
||||
equal(volumeControl.el().style.display, 'none', 'volumeControl is not hidden');
|
||||
equal(muteToggle.el().style.display, 'none', 'muteToggle is not hidden');
|
||||
ok(volumeControl.el().className.indexOf('vjs-disabled') >= 0, 'volumeControl is not hidden');
|
||||
ok(muteToggle.el().className.indexOf('vjs-disabled') >= 0, 'muteToggle is not hidden');
|
||||
});
|
||||
|
||||
test('should test and toggle volume control on `loadstart`', function(){
|
||||
@ -45,34 +45,28 @@ test('should test and toggle volume control on `loadstart`', function(){
|
||||
volumeControl = new vjs.VolumeControl(player);
|
||||
muteToggle = new vjs.MuteToggle(player);
|
||||
|
||||
equal(volumeControl.el().style.display,
|
||||
'',
|
||||
'volumeControl is hidden initially');
|
||||
equal(muteToggle.el().style.display,
|
||||
'',
|
||||
'muteToggle is hidden initially');
|
||||
ok(volumeControl.el().className.indexOf('vjs-disabled') < 0,
|
||||
'volumeControl is hidden initially');
|
||||
ok(muteToggle.el().className.indexOf('vjs-disabled') < 0,
|
||||
'muteToggle is hidden initially');
|
||||
|
||||
player.tech.features.volumeControl = false;
|
||||
listeners.forEach(function(listener) {
|
||||
listener();
|
||||
});
|
||||
|
||||
equal(volumeControl.el().style.display,
|
||||
'none',
|
||||
'volumeControl does not hide itself');
|
||||
equal(muteToggle.el().style.display,
|
||||
'none',
|
||||
'muteToggle does not hide itself');
|
||||
ok(volumeControl.el().className.indexOf('vjs-disabled') >= 0,
|
||||
'volumeControl does not hide itself');
|
||||
ok(muteToggle.el().className.indexOf('vjs-disabled') >= 0,
|
||||
'muteToggle does not hide itself');
|
||||
|
||||
player.tech.features.volumeControl = true;
|
||||
listeners.forEach(function(listener) {
|
||||
listener();
|
||||
});
|
||||
|
||||
equal(volumeControl.el().style.display,
|
||||
'block',
|
||||
'volumeControl does not show itself');
|
||||
equal(muteToggle.el().style.display,
|
||||
'block',
|
||||
'muteToggle does not show itself');
|
||||
ok(volumeControl.el().className.indexOf('vjs-disabled') < 0,
|
||||
'volumeControl does not show itself');
|
||||
ok(muteToggle.el().className.indexOf('vjs-disabled') < 0,
|
||||
'muteToggle does not show itself');
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user