diff options
author | Max Beatty <max@beatty.me> | 2016-08-05 02:57:08 +0300 |
---|---|---|
committer | Max Beatty <max@beatty.me> | 2016-08-05 02:57:08 +0300 |
commit | dc1b4e78d49e7c3caedc2918298b646cf8c8200b (patch) | |
tree | 830e735042b919176aaf1c17fcb872ebe9b9fecc /js/tests/unit/tab.js | |
parent | 0416f761dddae04a1b4d3ce70afece518330ca4d (diff) |
add support for ol in tab plugin. fixes #17754
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 2e01432930..522ed0b3e4 100644 --- a/js/tests/unit/tab.js +++ b/js/tests/unit/tab.js @@ -76,6 +76,22 @@ $(function () { assert.strictEqual($('#qunit-fixture').find('.active').attr('id'), 'home') }) + QUnit.test('should activate element by tab id in ordered list', function (assert) { + assert.expect(2) + var pillsHTML = '<ol class="pills">' + + '<li><a href="#home">Home</a></li>' + + '<li><a href="#profile">Profile</a></li>' + + '</ol>' + + $('<ol><li id="home"/><li id="profile"/></ol>').appendTo('#qunit-fixture') + + $(pillsHTML).find('li:last a').bootstrapTab('show') + assert.strictEqual($('#qunit-fixture').find('.active').attr('id'), 'profile') + + $(pillsHTML).find('li:first a').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() |