diff options
author | Johann-S <johann.servoire@gmail.com> | 2016-12-28 13:58:50 +0300 |
---|---|---|
committer | Mark Otto <markd.otto@gmail.com> | 2016-12-31 11:54:00 +0300 |
commit | 026e1a1421a7e398f743e49710a0e9f003374753 (patch) | |
tree | e9e3bca76bcfc54335900c6de20d8eb0fd39f8e1 /js/tests/unit/tab.js | |
parent | d935cca9f6d694907ce0acca3703e62d973938c0 (diff) |
Allow to use nav with tab JS
Diffstat (limited to 'js/tests/unit/tab.js')
-rw-r--r-- | js/tests/unit/tab.js | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/js/tests/unit/tab.js b/js/tests/unit/tab.js index 62eece896a..734648e9ec 100644 --- a/js/tests/unit/tab.js +++ b/js/tests/unit/tab.js @@ -92,6 +92,22 @@ $(function () { assert.strictEqual($('#qunit-fixture').find('.active').attr('id'), 'home') }) + QUnit.test('should activate element by tab id in nav list', function (assert) { + assert.expect(2) + var tabsHTML = '<nav class="nav">' + + '<a href="#home">Home</a>' + + '<a href="#profile">Profile</a>' + + '</nav>' + + $('<nav><div id="home"></div><div id="profile"></div></nav>').appendTo('#qunit-fixture') + + $(tabsHTML).find('a:last').bootstrapTab('show') + assert.strictEqual($('#qunit-fixture').find('.active').attr('id'), 'profile') + + $(tabsHTML).find('a:first').bootstrapTab('show') + assert.strictEqual($('#qunit-fixture').find('.active').attr('id'), 'home') + }) + QUnit.test('should not fire shown when show is prevented', function (assert) { assert.expect(1) var done = assert.async() |