Skip to content

Commit

Permalink
@misteroneill updated tests to qunit 2.0. closes #3509
Browse files Browse the repository at this point in the history
  • Loading branch information
misteroneill authored and gkatsev committed Aug 12, 2016
1 parent b3e4e95 commit 72c44da
Show file tree
Hide file tree
Showing 45 changed files with 1,701 additions and 1,700 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ CHANGELOG
* @BrandonOCasey updated language docs to link to IANA language registry ([view](https://github.com/videojs/video.js/pull/3493))
* @gkatsev removed unused dependencies ([view](https://github.com/videojs/video.js/pull/3516))
* @misteroneill enabled and updated videojs-standard and fixed an issue with linting ([view](https://github.com/videojs/video.js/pull/3508))
* @misteroneill updated tests to qunit 2.0 ([view](https://github.com/videojs/video.js/pull/3509))

--------------------

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"karma-sinon": "^1.0.5",
"load-grunt-tasks": "^3.1.0",
"proxyquireify": "^3.0.0",
"qunitjs": "^1.18.0",
"qunitjs": "^2.0.1",
"sinon": "^1.16.1",
"time-grunt": "^1.1.1",
"uglify-js": "~2.3.6",
Expand Down
308 changes: 154 additions & 154 deletions test/api/api.js

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions test/unit/button.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import TestHelpers from './test-helpers.js';

QUnit.module('Button');

QUnit.test('should localize its text', function() {
QUnit.expect(3);
QUnit.test('should localize its text', function(assert) {
assert.expect(3);

const player = TestHelpers.makePlayer({
language: 'es',
Expand All @@ -21,7 +21,7 @@ QUnit.test('should localize its text', function() {
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');
assert.ok(el.nodeName.toLowerCase().match('button'));
assert.ok(el.innerHTML.match(/vjs-control-text"?>Juego/));
assert.equal(el.getAttribute('title'), 'Juego');
});
18 changes: 9 additions & 9 deletions test/unit/clickable-component.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,37 @@ import TestHelpers from './test-helpers.js';

QUnit.module('ClickableComponent');

QUnit.test('should create a div with role="button"', function() {
QUnit.expect(2);
QUnit.test('should create a div with role="button"', function(assert) {
assert.expect(2);

const player = TestHelpers.makePlayer({});

const testClickableComponent = new ClickableComponent(player);
const el = testClickableComponent.createEl();

QUnit.equal(el.nodeName.toLowerCase(), 'div', 'the name of the element is "div"');
QUnit.equal(el.getAttribute('role').toLowerCase(), 'button', 'the role of the element is "button"');
assert.equal(el.nodeName.toLowerCase(), 'div', 'the name of the element is "div"');
assert.equal(el.getAttribute('role').toLowerCase(), 'button', 'the role of the element is "button"');

testClickableComponent.dispose();
player.dispose();
});

QUnit.test('should be enabled/disabled', function() {
QUnit.expect(3);
QUnit.test('should be enabled/disabled', function(assert) {
assert.expect(3);

const player = TestHelpers.makePlayer({});

const testClickableComponent = new ClickableComponent(player);

QUnit.equal(testClickableComponent.hasClass('vjs-disabled'), false, 'ClickableComponent defaults to enabled');
assert.equal(testClickableComponent.hasClass('vjs-disabled'), false, 'ClickableComponent defaults to enabled');

testClickableComponent.disable();

QUnit.equal(testClickableComponent.hasClass('vjs-disabled'), true, 'ClickableComponent is disabled');
assert.equal(testClickableComponent.hasClass('vjs-disabled'), true, 'ClickableComponent is disabled');

testClickableComponent.enable();

QUnit.equal(testClickableComponent.hasClass('vjs-disabled'), false, 'ClickableComponent is enabled');
assert.equal(testClickableComponent.hasClass('vjs-disabled'), false, 'ClickableComponent is enabled');

testClickableComponent.dispose();
player.dispose();
Expand Down
Loading

0 comments on commit 72c44da

Please sign in to comment.