diff options
author | Chris Rebert <code@rebertia.com> | 2015-01-21 06:40:50 +0300 |
---|---|---|
committer | Chris Rebert <code@rebertia.com> | 2015-01-21 06:57:51 +0300 |
commit | b56d97f21065037523ec17f45685916df8aca678 (patch) | |
tree | b519beaf24b689866298bba284234e812db9ad53 /js/tests/unit/tab.js | |
parent | a8139a03921541a7b66f97a0cbbdd1f5a597bdb8 (diff) |
update JS unit tests to future-proof QUnit 1.16.0 API
[skip validator]
Diffstat (limited to 'js/tests/unit/tab.js')
-rw-r--r-- | js/tests/unit/tab.js | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/js/tests/unit/tab.js b/js/tests/unit/tab.js index 9b2a18d572..fa87169161 100644 --- a/js/tests/unit/tab.js +++ b/js/tests/unit/tab.js @@ -59,14 +59,14 @@ $(function () { equal($('#qunit-fixture').find('.active').attr('id'), 'home') }) - test('should not fire shown when show is prevented', function () { - stop() + test('should not fire shown when show is prevented', function (assert) { + var done = assert.async() $('<div class="tab"/>') .on('show.bs.tab', function (e) { e.preventDefault() ok(true, 'show event fired') - start() + done() }) .on('shown.bs.tab', function () { ok(false, 'shown event fired') @@ -74,8 +74,8 @@ $(function () { .bootstrapTab('show') }) - test('show and shown events should reference correct relatedTarget', function () { - stop() + test('show and shown events should reference correct relatedTarget', function (assert) { + var done = assert.async() var dropHTML = '<ul class="drop">' + '<li class="dropdown"><a data-toggle="dropdown" href="#">1</a>' @@ -93,7 +93,7 @@ $(function () { .find('ul > li:last a') .on('show.bs.tab', function (e) { equal(e.relatedTarget.hash, '#1-1', 'references correct element as relatedTarget') - start() + done() }) .on('shown.bs.tab', function (e) { equal(e.relatedTarget.hash, '#1-1', 'references correct element as relatedTarget') @@ -101,8 +101,8 @@ $(function () { .bootstrapTab('show') }) - test('should fire hide and hidden events', function () { - stop() + test('should fire hide and hidden events', function (assert) { + var done = assert.async() var tabsHTML = '<ul class="tabs">' + '<li><a href="#home">Home</a></li>' @@ -123,7 +123,7 @@ $(function () { .find('li:first a') .on('hidden.bs.tab', function () { ok(true, 'hidden event fired') - start() + done() }) .bootstrapTab('show') .end() @@ -131,8 +131,8 @@ $(function () { .bootstrapTab('show') }) - test('should not fire hidden when hide is prevented', function () { - stop() + test('should not fire hidden when hide is prevented', function (assert) { + var done = assert.async() var tabsHTML = '<ul class="tabs">' + '<li><a href="#home">Home</a></li>' @@ -144,7 +144,7 @@ $(function () { .on('hide.bs.tab', function (e) { e.preventDefault() ok(true, 'hide event fired') - start() + done() }) .on('hidden.bs.tab', function () { ok(false, 'hidden event fired') @@ -155,8 +155,8 @@ $(function () { .bootstrapTab('show') }) - test('hide and hidden events contain correct relatedTarget', function () { - stop() + test('hide and hidden events contain correct relatedTarget', function (assert) { + var done = assert.async() var tabsHTML = '<ul class="tabs">' + '<li><a href="#home">Home</a></li>' @@ -170,7 +170,7 @@ $(function () { }) .on('hidden.bs.tab', function (e) { equal(e.relatedTarget.hash, '#profile', 'references correct element as relatedTarget') - start() + done() }) .bootstrapTab('show') .end() |