1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-16 10:34:07 +02:00

add support for ol in tab plugin. fixes #17754

This commit is contained in:
Max Beatty
2016-08-04 16:57:08 -07:00
parent 0416f761dd
commit dc1b4e78d4
2 changed files with 21 additions and 5 deletions

View File

@@ -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()