diff options
| author | Chris Rebert <[email protected]> | 2015-01-21 13:00:12 -0800 |
|---|---|---|
| committer | Chris Rebert <[email protected]> | 2015-01-21 13:00:12 -0800 |
| commit | 9238337cbbad3bc45fa036f5f1ed63dec86d2968 (patch) | |
| tree | a1fa418cb91eb698d97db9ed0745f86488383f99 /js/tests/unit/tab.js | |
| parent | 9e0c4ff786217d585f427de5c7a3f87ac86f3648 (diff) | |
| parent | 1ce502dc4de0accf27a6c37c21d26f4739d09241 (diff) | |
| download | bootstrap-9238337cbbad3bc45fa036f5f1ed63dec86d2968.tar.xz bootstrap-9238337cbbad3bc45fa036f5f1ed63dec86d2968.zip | |
Merge branch 'master' into v4
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 9b2a18d57..1228ae3fa 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,16 +93,16 @@ $(function () { .find('ul > li:last a') .on('show.bs.tab', function (e) { equal(e.relatedTarget.hash, '#1-1', 'references correct element as relatedTarget') - start() }) .on('shown.bs.tab', function (e) { equal(e.relatedTarget.hash, '#1-1', 'references correct element as relatedTarget') + done() }) .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() |
