diff options
| author | Mark Otto <[email protected]> | 2017-03-18 16:50:02 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2017-03-18 16:50:02 -0700 |
| commit | eb2a9da5b4123ada8e564ba0045132b18bd135ba (patch) | |
| tree | 7d3740bac126c68d5b84abb067fda7243d681c69 /js/tests/unit | |
| parent | 5f3473258e5e9f3d2d9da165312e8374c55250e6 (diff) | |
| parent | 1a46d8c7309092566c2da8cbaa9999ae0a1bacc7 (diff) | |
| download | bootstrap-eb2a9da5b4123ada8e564ba0045132b18bd135ba.tar.xz bootstrap-eb2a9da5b4123ada8e564ba0045132b18bd135ba.zip | |
Merge branch 'v4-dev' of https://github.com/twbs/bootstrap into v4-dev
Diffstat (limited to 'js/tests/unit')
| -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 734648e9e..d0aeb372b 100644 --- a/js/tests/unit/tab.js +++ b/js/tests/unit/tab.js @@ -108,6 +108,22 @@ $(function () { assert.strictEqual($('#qunit-fixture').find('.active').attr('id'), 'home') }) + QUnit.test('should activate element by tab id in list-group', function (assert) { + assert.expect(2) + var ulHTML = '<ul class="list-group">' + + '<li class="list-group-item"><a href="#home">Home</a></li>' + + '<li class="list-group-item"><a href="#profile">Profile</a></li>' + + '</ul>' + + $('<ul><li id="home"></li><li id="profile"></div></li>').appendTo('#qunit-fixture') + + $(ulHTML).find('li:last a').bootstrapTab('show') + assert.strictEqual($('#qunit-fixture').find('.active').attr('id'), 'profile') + + $(ulHTML).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() |
