diff options
author | Chris Rebert <code@rebertia.com> | 2015-02-24 09:04:48 +0300 |
---|---|---|
committer | Chris Rebert <code@rebertia.com> | 2015-02-24 09:14:11 +0300 |
commit | 118b8c2695d026f1cad6cffc177d9672d9903ce9 (patch) | |
tree | 552a1eede8d8b3fcbf9ecfd3123a728af8e19806 /js/tests/unit/tab.js | |
parent | 7c19fee3f1f3a371445981cf7e88a3af92f3b602 (diff) |
JS unit tests: use QUnit.module() & QUnit.test() everywhere
[skip validator]
Diffstat (limited to 'js/tests/unit/tab.js')
-rw-r--r-- | js/tests/unit/tab.js | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/js/tests/unit/tab.js b/js/tests/unit/tab.js index c2a14c98a1..a76b4e0cd5 100644 --- a/js/tests/unit/tab.js +++ b/js/tests/unit/tab.js @@ -1,13 +1,13 @@ $(function () { 'use strict'; - module('tabs plugin') + QUnit.module('tabs plugin') - test('should be defined on jquery object', function (assert) { + QUnit.test('should be defined on jquery object', function (assert) { assert.ok($(document.body).tab, 'tabs method is defined') }) - module('tabs', { + QUnit.module('tabs', { setup: function () { // Run all tests in noConflict mode -- it's the only way to ensure that the plugin works in noConflict mode $.fn.bootstrapTab = $.fn.tab.noConflict() @@ -18,18 +18,18 @@ $(function () { } }) - test('should provide no conflict', function (assert) { + QUnit.test('should provide no conflict', function (assert) { assert.strictEqual($.fn.tab, undefined, 'tab was set back to undefined (org value)') }) - test('should return jquery collection containing the element', function (assert) { + QUnit.test('should return jquery collection containing the element', function (assert) { var $el = $('<div/>') var $tab = $el.bootstrapTab() assert.ok($tab instanceof $, 'returns jquery collection') assert.strictEqual($tab[0], $el[0], 'collection contains element') }) - test('should activate element by tab id', function (assert) { + QUnit.test('should activate element by tab id', function (assert) { var tabsHTML = '<ul class="tabs">' + '<li><a href="#home">Home</a></li>' + '<li><a href="#profile">Profile</a></li>' @@ -44,7 +44,7 @@ $(function () { assert.equal($('#qunit-fixture').find('.active').attr('id'), 'home') }) - test('should activate element by tab id', function (assert) { + QUnit.test('should activate element by tab id', function (assert) { var pillsHTML = '<ul class="pills">' + '<li><a href="#home">Home</a></li>' + '<li><a href="#profile">Profile</a></li>' @@ -59,7 +59,7 @@ $(function () { assert.equal($('#qunit-fixture').find('.active').attr('id'), 'home') }) - test('should not fire shown when show is prevented', function (assert) { + QUnit.test('should not fire shown when show is prevented', function (assert) { var done = assert.async() $('<div class="tab"/>') @@ -74,7 +74,7 @@ $(function () { .bootstrapTab('show') }) - test('show and shown events should reference correct relatedTarget', function (assert) { + QUnit.test('show and shown events should reference correct relatedTarget', function (assert) { var done = assert.async() var dropHTML = '<ul class="drop">' @@ -101,7 +101,7 @@ $(function () { .bootstrapTab('show') }) - test('should fire hide and hidden events', function (assert) { + QUnit.test('should fire hide and hidden events', function (assert) { var done = assert.async() var tabsHTML = '<ul class="tabs">' @@ -131,7 +131,7 @@ $(function () { .bootstrapTab('show') }) - test('should not fire hidden when hide is prevented', function (assert) { + QUnit.test('should not fire hidden when hide is prevented', function (assert) { var done = assert.async() var tabsHTML = '<ul class="tabs">' @@ -155,7 +155,7 @@ $(function () { .bootstrapTab('show') }) - test('hide and hidden events contain correct relatedTarget', function (assert) { + QUnit.test('hide and hidden events contain correct relatedTarget', function (assert) { var done = assert.async() var tabsHTML = '<ul class="tabs">' @@ -178,7 +178,7 @@ $(function () { .bootstrapTab('show') }) - test('selected tab should have aria-expanded', function (assert) { + QUnit.test('selected tab should have aria-expanded', function (assert) { var tabsHTML = '<ul class="nav nav-tabs">' + '<li class="active"><a href="#home" toggle="tab" aria-expanded="true">Home</a></li>' + '<li><a href="#profile" toggle="tab" aria-expanded="false">Profile</a></li>' |