Skip to content

Commit

Permalink
Tweak unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickhlauke committed Mar 2, 2021
1 parent fa49414 commit 66d9ed7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions js/tests/unit/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ $(function () {

QUnit.test('should throw explicit error on undefined method', function (assert) {
assert.expect(1)
var $el = $('<div/>')
var $el = $('<div></div>')
$el.bootstrapTab()
try {
$el.bootstrapTab('noMethod')
Expand All @@ -38,7 +38,7 @@ $(function () {

QUnit.test('should return jquery collection containing the element', function (assert) {
assert.expect(2)
var $el = $('<div/>')
var $el = $('<div></div>')
var $tab = $el.bootstrapTab()
assert.ok($tab instanceof $, 'returns jquery collection')
assert.strictEqual($tab[0], $el[0], 'collection contains element')
Expand All @@ -51,7 +51,7 @@ $(function () {
'<li><button type="button" data-target="#profile" role="tab">Profile</button></li>' +
'</ul>'

$('<ul><li id="home" role="tabpanel"/><li id="profile" role="tabpanel"/></ul>').appendTo('#qunit-fixture')
$('<ul><li id="home" role="tabpanel"></li><li id="profile" role="tabpanel"></li></ul>').appendTo('#qunit-fixture')

$(tabsHTML).find('li:last-child button').bootstrapTab('show')
assert.strictEqual($('#qunit-fixture').find('.active').attr('id'), 'profile')
Expand All @@ -67,7 +67,7 @@ $(function () {
'<li><a href="#profile" role="tab">Profile</a></li>' +
'</ul>'

$('<ul><li id="home" role="tabpanel"/><li id="profile" role="tabpanel"/></ul>').appendTo('#qunit-fixture')
$('<ul><li id="home" role="tabpanel"></li><li id="profile" role="tabpanel"></li></ul>').appendTo('#qunit-fixture')

$(tabsHTML).find('li:last-child a').bootstrapTab('show')
assert.strictEqual($('#qunit-fixture').find('.active').attr('id'), 'profile')
Expand All @@ -83,7 +83,7 @@ $(function () {
'<li><a href="#profile">Profile</a></li>' +
'</ul>'

$('<ul><li id="home"/><li id="profile"/></ul>').appendTo('#qunit-fixture')
$('<ul><li id="home"></li><li id="profile"></li></ul>').appendTo('#qunit-fixture')

$(pillsHTML).find('li:last-child a').bootstrapTab('show')
assert.strictEqual($('#qunit-fixture').find('.active').attr('id'), 'profile')
Expand All @@ -99,7 +99,7 @@ $(function () {
'<li><button type="button" href="#profile" role="tab">Profile</button></li>' +
'</ol>'

$('<ol><li id="home" role="tabpanel"/><li id="profile" role="tabpanel"/></ol>').appendTo('#qunit-fixture')
$('<ol><li id="home" role="tabpanel"></li><li id="profile" role="tabpanel"></li></ol>').appendTo('#qunit-fixture')

$(pillsHTML).find('li:last-child button').bootstrapTab('show')
assert.strictEqual($('#qunit-fixture').find('.active').attr('id'), 'profile')
Expand Down Expand Up @@ -144,7 +144,7 @@ $(function () {
assert.expect(1)
var done = assert.async()

$('<div class="nav"/>')
$('<div class="nav"></div>')
.on('show.bs.tab', function (e) {
e.preventDefault()
assert.ok(true, 'show event fired')
Expand Down

0 comments on commit 66d9ed7

Please sign in to comment.