Switch to assert.strictEqual
This commit is contained in:
parent
729bafe081
commit
715e5b8711
10 changed files with 133 additions and 134 deletions
|
|
@ -36,9 +36,9 @@ $(function () {
|
|||
QUnit.test('should toggle active', function (assert) {
|
||||
assert.expect(2)
|
||||
var $btn = $('<button class="btn" data-toggle="button">mdo</button>')
|
||||
assert.equal($btn.hasClass('active'), false, 'btn does not have active class')
|
||||
assert.strictEqual($btn.hasClass('active'), false, 'btn does not have active class')
|
||||
$btn.bootstrapButton('toggle')
|
||||
assert.ok($btn.hasClass('active'), 'btn has class active')
|
||||
assert.strictEqual($btn.hasClass('active'), true, 'btn has class active')
|
||||
})
|
||||
|
||||
QUnit.test('should toggle active when btn children are clicked', function (assert) {
|
||||
|
|
@ -48,9 +48,9 @@ $(function () {
|
|||
$btn
|
||||
.append($inner)
|
||||
.appendTo('#qunit-fixture')
|
||||
assert.equal($btn.hasClass('active'), false, 'btn does not have active class')
|
||||
assert.strictEqual($btn.hasClass('active'), false, 'btn does not have active class')
|
||||
$inner.trigger('click')
|
||||
assert.ok($btn.hasClass('active'), 'btn has class active')
|
||||
assert.strictEqual($btn.hasClass('active'), true, 'btn has class active')
|
||||
})
|
||||
|
||||
QUnit.test('should toggle aria-pressed', function (assert) {
|
||||
|
|
@ -107,7 +107,7 @@ $(function () {
|
|||
$btn.appendTo('#qunit-fixture')
|
||||
$(window).trigger($.Event('load'))
|
||||
setTimeout(function () {
|
||||
assert.ok($btn.hasClass('active'), 'button with aria-pressed="true" has been given class active')
|
||||
assert.strictEqual($btn.hasClass('active'), true, 'button with aria-pressed="true" has been given class active')
|
||||
done()
|
||||
}, 5)
|
||||
})
|
||||
|
|
@ -125,7 +125,7 @@ $(function () {
|
|||
|
||||
$(window).trigger($.Event('load'))
|
||||
setTimeout(function () {
|
||||
assert.ok($btn.hasClass('active'), 'checked checkbox button has been given class active')
|
||||
assert.strictEqual($btn.hasClass('active'), true, 'checked checkbox button has been given class active')
|
||||
done()
|
||||
}, 5)
|
||||
})
|
||||
|
|
@ -137,7 +137,7 @@ $(function () {
|
|||
$btn.appendTo('#qunit-fixture')
|
||||
$(window).trigger($.Event('load'))
|
||||
setTimeout(function () {
|
||||
assert.equal($btn.hasClass('active'), false, 'button without aria-pressed="true" has had active class removed')
|
||||
assert.strictEqual($btn.hasClass('active'), false, 'button without aria-pressed="true" has had active class removed')
|
||||
done()
|
||||
}, 5)
|
||||
})
|
||||
|
|
@ -155,7 +155,7 @@ $(function () {
|
|||
|
||||
$(window).trigger($.Event('load'))
|
||||
setTimeout(function () {
|
||||
assert.equal($btn.hasClass('active'), false, 'unchecked checkbox button has had active class removed')
|
||||
assert.strictEqual($btn.hasClass('active'), false, 'unchecked checkbox button has had active class removed')
|
||||
done()
|
||||
}, 5)
|
||||
})
|
||||
|
|
@ -224,28 +224,28 @@ $(function () {
|
|||
var $btn1 = $group.children().eq(0)
|
||||
var $btn2 = $group.children().eq(1)
|
||||
|
||||
assert.ok($btn1.hasClass('active'), 'btn1 has active class')
|
||||
assert.strictEqual($btn1.hasClass('active'), true, 'btn1 has active class')
|
||||
assert.ok($btn1.find('input').prop('checked'), 'btn1 is checked')
|
||||
assert.equal($btn2.hasClass('active'), false, 'btn2 does not have active class')
|
||||
assert.equal($btn2.find('input').prop('checked'), false, 'btn2 is not checked')
|
||||
assert.strictEqual($btn2.hasClass('active'), false, 'btn2 does not have active class')
|
||||
assert.strictEqual($btn2.find('input').prop('checked'), false, 'btn2 is not checked')
|
||||
$btn2.find('input').trigger('click')
|
||||
assert.equal($btn1.hasClass('active'), false, 'btn1 does not have active class')
|
||||
assert.equal($btn1.find('input').prop('checked'), false, 'btn1 is not checked')
|
||||
assert.ok($btn2.hasClass('active'), 'btn2 has active class')
|
||||
assert.strictEqual($btn1.hasClass('active'), false, 'btn1 does not have active class')
|
||||
assert.strictEqual($btn1.find('input').prop('checked'), false, 'btn1 is not checked')
|
||||
assert.strictEqual($btn2.hasClass('active'), true, 'btn2 has active class')
|
||||
assert.ok($btn2.find('input').prop('checked'), 'btn2 is checked')
|
||||
|
||||
$btn2.find('input').trigger('click') // Clicking an already checked radio should not un-check it
|
||||
assert.equal($btn1.hasClass('active'), false, 'btn1 does not have active class')
|
||||
assert.equal($btn1.find('input').prop('checked'), false, 'btn1 is not checked')
|
||||
assert.ok($btn2.hasClass('active'), 'btn2 has active class')
|
||||
assert.strictEqual($btn1.hasClass('active'), false, 'btn1 does not have active class')
|
||||
assert.strictEqual($btn1.find('input').prop('checked'), false, 'btn1 is not checked')
|
||||
assert.strictEqual($btn2.hasClass('active'), true, 'btn2 has active class')
|
||||
assert.ok($btn2.find('input').prop('checked'), 'btn2 is checked')
|
||||
$btn1.bootstrapButton('toggle')
|
||||
assert.ok($btn1.hasClass('active'), 'btn1 has active class')
|
||||
assert.strictEqual($btn1.hasClass('active'), true, 'btn1 has active class')
|
||||
assert.ok($btn1.find('input').prop('checked'), 'btn1 prop is checked')
|
||||
assert.ok($btn1.find('input')[0].checked, 'btn1 is checked with jquery')
|
||||
assert.equal($btn2.hasClass('active'), false, 'btn2 does not have active class')
|
||||
assert.equal($btn2.find('input').prop('checked'), false, 'btn2 is not checked')
|
||||
assert.equal($btn2.find('input')[0].checked, false, 'btn2 is not checked')
|
||||
assert.strictEqual($btn2.hasClass('active'), false, 'btn2 does not have active class')
|
||||
assert.strictEqual($btn2.find('input').prop('checked'), false, 'btn2 is not checked')
|
||||
assert.strictEqual($btn2.find('input')[0].checked, false, 'btn2 is not checked')
|
||||
})
|
||||
|
||||
QUnit.test('should fire click event on input', function (assert) {
|
||||
|
|
@ -319,10 +319,10 @@ $(function () {
|
|||
var $input = $btn.children().eq(0)
|
||||
|
||||
assert.ok($btn.is(':not(.active)'), 'button is initially not active')
|
||||
assert.equal($input.prop('checked'), false, 'checkbox is initially not checked')
|
||||
assert.strictEqual($input.prop('checked'), false, 'checkbox is initially not checked')
|
||||
$btn[0].click() // fire a real click on the DOM node itself, not a click() on the jQuery object that just aliases to trigger('click')
|
||||
assert.ok($btn.is(':not(.active)'), 'button did not become active')
|
||||
assert.equal($input.prop('checked'), false, 'checkbox did not get checked')
|
||||
assert.strictEqual($input.prop('checked'), false, 'checkbox did not get checked')
|
||||
})
|
||||
|
||||
QUnit.test('should not set active class if inner hidden checkbox is disabled but author forgot to set disabled class on outer button', function (assert) {
|
||||
|
|
@ -338,10 +338,10 @@ $(function () {
|
|||
var $input = $btn.children().eq(0)
|
||||
|
||||
assert.ok($btn.is(':not(.active)'), 'button is initially not active')
|
||||
assert.equal($input.prop('checked'), false, 'checkbox is initially not checked')
|
||||
assert.strictEqual($input.prop('checked'), false, 'checkbox is initially not checked')
|
||||
$btn[0].click() // fire a real click on the DOM node itself, not a click() on the jQuery object that just aliases to trigger('click')
|
||||
assert.ok($btn.is(':not(.active)'), 'button did not become active')
|
||||
assert.equal($input.prop('checked'), false, 'checkbox did not get checked')
|
||||
assert.strictEqual($input.prop('checked'), false, 'checkbox did not get checked')
|
||||
})
|
||||
|
||||
QUnit.test('should correctly set checked state on input and active class on label when using <label><input></label> structure', function (assert) {
|
||||
|
|
@ -357,7 +357,7 @@ $(function () {
|
|||
var $input = $label.children().eq(0)
|
||||
|
||||
assert.ok($label.is(':not(.active)'), 'label is initially not active')
|
||||
assert.equal($input.prop('checked'), false, 'checkbox is initially not checked')
|
||||
assert.strictEqual($input.prop('checked'), false, 'checkbox is initially not checked')
|
||||
$label[0].click() // fire a real click on the DOM node itself, not a click() on the jQuery object that just aliases to trigger('click')
|
||||
assert.ok($label.is('.active'), 'label is active after click')
|
||||
assert.ok($input.prop('checked'), 'checkbox is checked after click')
|
||||
|
|
@ -376,7 +376,7 @@ $(function () {
|
|||
var $input = $btn.children().eq(0)
|
||||
|
||||
assert.ok($btn.is(':not(.active)'), '<div> is initially not active')
|
||||
assert.equal($input.prop('checked'), false, 'checkbox is initially not checked')
|
||||
assert.strictEqual($input.prop('checked'), false, 'checkbox is initially not checked')
|
||||
$btn[0].click() // fire a real click on the DOM node itself, not a click() on the jQuery object that just aliases to trigger('click')
|
||||
assert.ok($btn.is('.active'), '<div> is active after click')
|
||||
assert.ok($input.prop('checked'), 'checkbox is checked after click')
|
||||
|
|
@ -395,8 +395,8 @@ $(function () {
|
|||
var $input = $btn.children().eq(0)
|
||||
|
||||
assert.ok($btn.is(':not(.active)'), '<label> is initially not active')
|
||||
assert.equal($input.prop('checked'), false, 'checkbox property is initially not checked')
|
||||
assert.equal($input[0].checked, false, 'checkbox is not checked by jquery after click')
|
||||
assert.strictEqual($input.prop('checked'), false, 'checkbox property is initially not checked')
|
||||
assert.strictEqual($input[0].checked, false, 'checkbox is not checked by jquery after click')
|
||||
$btn.bootstrapButton('toggle')
|
||||
assert.ok($btn.is('.active'), '<label> is active after click')
|
||||
assert.ok($input.prop('checked'), 'checkbox property is checked after click')
|
||||
|
|
@ -416,10 +416,10 @@ $(function () {
|
|||
var $input = $label.children().eq(0)
|
||||
|
||||
assert.ok($label.is(':not(.active)'), 'label is initially not active')
|
||||
assert.equal($input.prop('checked'), false, 'checkbox is initially not checked')
|
||||
assert.strictEqual($input.prop('checked'), false, 'checkbox is initially not checked')
|
||||
$group[0].click() // fire a real click on the DOM node itself, not a click() on the jQuery object that just aliases to trigger('click')
|
||||
assert.ok($label.is(':not(.active)'), 'label is not active after click')
|
||||
assert.equal($input.prop('checked'), false, 'checkbox is not checked after click')
|
||||
assert.strictEqual($input.prop('checked'), false, 'checkbox is not checked after click')
|
||||
})
|
||||
|
||||
QUnit.test('should not try and set checked property on an input of type="hidden"', function (assert) {
|
||||
|
|
@ -434,9 +434,9 @@ $(function () {
|
|||
var $label = $group.children().eq(0)
|
||||
var $input = $label.children().eq(0)
|
||||
|
||||
assert.equal($input.prop('checked'), false, 'hidden input initially has no checked property')
|
||||
assert.strictEqual($input.prop('checked'), false, 'hidden input initially has no checked property')
|
||||
$label[0].click() // fire a real click on the DOM node itself, not a click() on the jQuery object that just aliases to trigger('click')
|
||||
assert.equal($input.prop('checked'), false, 'hidden input does not have a checked property')
|
||||
assert.strictEqual($input.prop('checked'), false, 'hidden input does not have a checked property')
|
||||
})
|
||||
|
||||
QUnit.test('should not try and set checked property on an input that is not a radio button or checkbox', function (assert) {
|
||||
|
|
@ -451,9 +451,9 @@ $(function () {
|
|||
var $label = $group.children().eq(0)
|
||||
var $input = $label.children().eq(0)
|
||||
|
||||
assert.equal($input.prop('checked'), false, 'text input initially has no checked property')
|
||||
assert.strictEqual($input.prop('checked'), false, 'text input initially has no checked property')
|
||||
$label[0].click() // fire a real click on the DOM node itself, not a click() on the jQuery object that just aliases to trigger('click')
|
||||
assert.equal($input.prop('checked'), false, 'text input does not have a checked property')
|
||||
assert.strictEqual($input.prop('checked'), false, 'text input does not have a checked property')
|
||||
})
|
||||
|
||||
QUnit.test('dispose should remove data and the element', function (assert) {
|
||||
|
|
|
|||
|
|
@ -160,8 +160,8 @@ $(function () {
|
|||
})
|
||||
.one('slid.bs.carousel', function () {
|
||||
setTimeout(function () {
|
||||
assert.equal($carousel.find('.carousel-item:nth-child(1)').is('.active'), false, 'first item still active')
|
||||
assert.equal($carousel.find('.carousel-indicators li:nth-child(1)').is('.active'), false, 'first indicator still active')
|
||||
assert.strictEqual($carousel.find('.carousel-item:nth-child(1)').is('.active'), false, 'first item still active')
|
||||
assert.strictEqual($carousel.find('.carousel-indicators li:nth-child(1)').is('.active'), false, 'first indicator still active')
|
||||
assert.ok($carousel.find('.carousel-item:nth-child(2)').is('.active'), 'second item active')
|
||||
assert.ok($carousel.find('.carousel-indicators li:nth-child(2)').is('.active'), 'second indicator active')
|
||||
done()
|
||||
|
|
@ -321,7 +321,7 @@ $(function () {
|
|||
$(template)
|
||||
.on('slide.bs.carousel', function (e) {
|
||||
assert.ok(e.relatedTarget, 'relatedTarget present')
|
||||
assert.ok($(e.relatedTarget).hasClass('carousel-item'), 'relatedTarget has class "item"')
|
||||
assert.strictEqual($(e.relatedTarget).hasClass('carousel-item'), true, 'relatedTarget has class "item"')
|
||||
done()
|
||||
})
|
||||
.bootstrapCarousel('next')
|
||||
|
|
@ -368,7 +368,7 @@ $(function () {
|
|||
$(template)
|
||||
.on('slid.bs.carousel', function (e) {
|
||||
assert.ok(e.relatedTarget, 'relatedTarget present')
|
||||
assert.ok($(e.relatedTarget).hasClass('carousel-item'), 'relatedTarget has class "item"')
|
||||
assert.strictEqual($(e.relatedTarget).hasClass('carousel-item'), true, 'relatedTarget has class "item"')
|
||||
done()
|
||||
})
|
||||
.bootstrapCarousel('next')
|
||||
|
|
@ -985,14 +985,14 @@ $(function () {
|
|||
|
||||
var $firstItem = $('#firstItem')
|
||||
setTimeout(function () {
|
||||
assert.ok($firstItem.hasClass('active'))
|
||||
assert.strictEqual($firstItem.hasClass('active'), true)
|
||||
$html
|
||||
.bootstrapCarousel('dispose')
|
||||
.attr('style', 'visibility: hidden;')
|
||||
.bootstrapCarousel()
|
||||
|
||||
setTimeout(function () {
|
||||
assert.ok($firstItem.hasClass('active'))
|
||||
assert.strictEqual($firstItem.hasClass('active'), true)
|
||||
done()
|
||||
}, 80)
|
||||
}, 80)
|
||||
|
|
@ -1025,13 +1025,13 @@ $(function () {
|
|||
var $firstItem = $('#firstItem')
|
||||
|
||||
setTimeout(function () {
|
||||
assert.ok($firstItem.hasClass('active'))
|
||||
assert.strictEqual($firstItem.hasClass('active'), true)
|
||||
$carousel.bootstrapCarousel('dispose')
|
||||
$parent.attr('style', 'visibility: hidden;')
|
||||
$carousel.bootstrapCarousel()
|
||||
|
||||
setTimeout(function () {
|
||||
assert.ok($firstItem.hasClass('active'))
|
||||
assert.strictEqual($firstItem.hasClass('active'), true)
|
||||
done()
|
||||
}, 80)
|
||||
}, 80)
|
||||
|
|
@ -1069,7 +1069,7 @@ $(function () {
|
|||
|
||||
$carousel.one('slid.bs.carousel', function () {
|
||||
assert.ok(true, 'slid event fired')
|
||||
assert.ok($item.hasClass('active'))
|
||||
assert.strictEqual($item.hasClass('active'), true)
|
||||
assert.ok(spy.called)
|
||||
$styles.remove()
|
||||
delete document.documentElement.ontouchstart
|
||||
|
|
@ -1111,7 +1111,7 @@ $(function () {
|
|||
|
||||
$carousel.one('slid.bs.carousel', function () {
|
||||
assert.ok(true, 'slid event fired')
|
||||
assert.ok($item.hasClass('active'))
|
||||
assert.strictEqual($item.hasClass('active'), true)
|
||||
assert.ok(spy.called)
|
||||
delete document.documentElement.ontouchstart
|
||||
restorePointerEvents()
|
||||
|
|
@ -1158,7 +1158,7 @@ $(function () {
|
|||
|
||||
$carousel.one('slid.bs.carousel', function () {
|
||||
assert.ok(true, 'slid event fired')
|
||||
assert.equal($item.hasClass('active'), false)
|
||||
assert.strictEqual($item.hasClass('active'), false)
|
||||
assert.ok(spy.called)
|
||||
assert.strictEqual(carousel.touchDeltaX, 0)
|
||||
$styles.remove()
|
||||
|
|
@ -1202,7 +1202,7 @@ $(function () {
|
|||
|
||||
$carousel.one('slid.bs.carousel', function () {
|
||||
assert.ok(true, 'slid event fired')
|
||||
assert.equal($item.hasClass('active'), false)
|
||||
assert.strictEqual($item.hasClass('active'), false)
|
||||
assert.ok(spy.called)
|
||||
assert.strictEqual(carousel.touchDeltaX, 0)
|
||||
restorePointerEvents()
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ $(function () {
|
|||
|
||||
$el.one('shown.bs.collapse', function () {
|
||||
assert.ok($el.hasClass('show'), 'has class "show"')
|
||||
assert.equal(/height/i.test($el.attr('style')), false, 'has height reset')
|
||||
assert.strictEqual(/height/i.test($el.attr('style')), false, 'has height reset')
|
||||
done()
|
||||
}).bootstrapCollapse('show')
|
||||
})
|
||||
|
|
@ -64,11 +64,11 @@ $(function () {
|
|||
var $el2 = $('<div class="collapse multi"/>').appendTo('#qunit-fixture')
|
||||
$el.one('shown.bs.collapse', function () {
|
||||
assert.ok($el.hasClass('show'), 'has class "show"')
|
||||
assert.equal(/height/i.test($el.attr('style')), false, 'has height reset')
|
||||
assert.strictEqual(/height/i.test($el.attr('style')), false, 'has height reset')
|
||||
})
|
||||
$el2.one('shown.bs.collapse', function () {
|
||||
assert.ok($el2.hasClass('show'), 'has class "show"')
|
||||
assert.equal(/height/i.test($el2.attr('style')), false, 'has height reset')
|
||||
assert.strictEqual(/height/i.test($el2.attr('style')), false, 'has height reset')
|
||||
done()
|
||||
})
|
||||
$target.trigger('click')
|
||||
|
|
@ -103,7 +103,7 @@ $(function () {
|
|||
assert.expect(1)
|
||||
var $el = $('<div class="collapse"/>').bootstrapCollapse('hide')
|
||||
|
||||
assert.equal($el.hasClass('show'), false, 'does not have class "show"')
|
||||
assert.strictEqual($el.hasClass('show'), false, 'does not have class "show"')
|
||||
})
|
||||
|
||||
QUnit.test('should not fire shown when show is prevented', function (assert) {
|
||||
|
|
@ -161,7 +161,7 @@ $(function () {
|
|||
$('<div id="test1"/>')
|
||||
.appendTo('#qunit-fixture')
|
||||
.on('shown.bs.collapse', function () {
|
||||
assert.equal($target.hasClass('collapsed'), false, 'target does not have collapsed class')
|
||||
assert.strictEqual($target.hasClass('collapsed'), false, 'target does not have collapsed class')
|
||||
done()
|
||||
})
|
||||
|
||||
|
|
@ -194,8 +194,8 @@ $(function () {
|
|||
$('<div id="test1"/>')
|
||||
.appendTo('#qunit-fixture')
|
||||
.on('shown.bs.collapse', function () {
|
||||
assert.equal($target.hasClass('collapsed'), false, 'target trigger does not have collapsed class')
|
||||
assert.equal($alt.hasClass('collapsed'), false, 'alt trigger does not have collapsed class')
|
||||
assert.strictEqual($target.hasClass('collapsed'), false, 'target trigger does not have collapsed class')
|
||||
assert.strictEqual($alt.hasClass('collapsed'), false, 'alt trigger does not have collapsed class')
|
||||
done()
|
||||
})
|
||||
|
||||
|
|
@ -304,7 +304,7 @@ $(function () {
|
|||
.on('shown.bs.collapse', function () {
|
||||
assert.ok($target1.hasClass('collapsed'), 'inactive target 1 does have class "collapsed"')
|
||||
assert.ok($target2.hasClass('collapsed'), 'inactive target 2 does have class "collapsed"')
|
||||
assert.equal($target3.hasClass('collapsed'), false, 'active target 3 does not have class "collapsed"')
|
||||
assert.strictEqual($target3.hasClass('collapsed'), false, 'active target 3 does not have class "collapsed"')
|
||||
|
||||
done()
|
||||
})
|
||||
|
|
@ -338,7 +338,7 @@ $(function () {
|
|||
.on('shown.bs.collapse', function () {
|
||||
assert.ok($target1.hasClass('collapsed'), 'inactive target 1 does have class "collapsed"')
|
||||
assert.ok($target2.hasClass('collapsed'), 'inactive target 2 does have class "collapsed"')
|
||||
assert.equal($target3.hasClass('collapsed'), false, 'active target 3 does not have class "collapsed"')
|
||||
assert.strictEqual($target3.hasClass('collapsed'), false, 'active target 3 does not have class "collapsed"')
|
||||
|
||||
done()
|
||||
})
|
||||
|
|
@ -479,7 +479,7 @@ $(function () {
|
|||
$target1.trigger('click')
|
||||
|
||||
setTimeout(function () {
|
||||
assert.equal(showFired, false, 'show event did not fire')
|
||||
assert.strictEqual(showFired, false, 'show event did not fire')
|
||||
done()
|
||||
}, 1)
|
||||
})
|
||||
|
|
@ -508,7 +508,7 @@ $(function () {
|
|||
$('<div id="test1"/>')
|
||||
.appendTo('#qunit-fixture')
|
||||
.on('shown.bs.collapse', function () {
|
||||
assert.equal($target.hasClass('collapsed'), false)
|
||||
assert.strictEqual($target.hasClass('collapsed'), false)
|
||||
done()
|
||||
})
|
||||
.bootstrapCollapse('show')
|
||||
|
|
@ -535,9 +535,9 @@ $(function () {
|
|||
var $collapseTwo = $('#collapseTwo')
|
||||
$collapseOne.on('shown.bs.collapse', function () {
|
||||
assert.ok($collapseOne.hasClass('show'), '#collapseOne is shown')
|
||||
assert.equal($collapseTwo.hasClass('show'), false, '#collapseTwo is not shown')
|
||||
assert.strictEqual($collapseTwo.hasClass('show'), false, '#collapseTwo is not shown')
|
||||
$collapseTwo.on('shown.bs.collapse', function () {
|
||||
assert.equal($collapseOne.hasClass('show'), false, '#collapseOne is not shown')
|
||||
assert.strictEqual($collapseOne.hasClass('show'), false, '#collapseOne is not shown')
|
||||
assert.ok($collapseTwo.hasClass('show'), '#collapseTwo is shown')
|
||||
done()
|
||||
})
|
||||
|
|
@ -573,9 +573,9 @@ $(function () {
|
|||
var $collapseTwo = $('#collapseTwo')
|
||||
$collapseOne.on('shown.bs.collapse', function () {
|
||||
assert.ok($collapseOne.hasClass('show'), '#collapseOne is shown')
|
||||
assert.equal($collapseTwo.hasClass('show'), false, '#collapseTwo is not shown')
|
||||
assert.strictEqual($collapseTwo.hasClass('show'), false, '#collapseTwo is not shown')
|
||||
$collapseTwo.on('shown.bs.collapse', function () {
|
||||
assert.equal($collapseOne.hasClass('show'), false, '#collapseOne is not shown')
|
||||
assert.strictEqual($collapseOne.hasClass('show'), false, '#collapseOne is not shown')
|
||||
assert.ok($collapseTwo.hasClass('show'), '#collapseTwo is shown')
|
||||
done()
|
||||
})
|
||||
|
|
@ -611,14 +611,14 @@ $(function () {
|
|||
function firstTest() {
|
||||
assert.ok($collapseOneOne.hasClass('show'), '#collapseOneOne is shown')
|
||||
assert.ok($collapseOneTwo.hasClass('show'), '#collapseOneTwo is shown')
|
||||
assert.equal($collapseTwoOne.hasClass('show'), false, '#collapseTwoOne is not shown')
|
||||
assert.equal($collapseTwoTwo.hasClass('show'), false, '#collapseTwoTwo is not shown')
|
||||
assert.strictEqual($collapseTwoOne.hasClass('show'), false, '#collapseTwoOne is not shown')
|
||||
assert.strictEqual($collapseTwoTwo.hasClass('show'), false, '#collapseTwoTwo is not shown')
|
||||
$triggerTwo.trigger($.Event('click'))
|
||||
}
|
||||
|
||||
function secondTest() {
|
||||
assert.equal($collapseOneOne.hasClass('show'), false, '#collapseOneOne is not shown')
|
||||
assert.equal($collapseOneTwo.hasClass('show'), false, '#collapseOneTwo is not shown')
|
||||
assert.strictEqual($collapseOneOne.hasClass('show'), false, '#collapseOneOne is not shown')
|
||||
assert.strictEqual($collapseOneTwo.hasClass('show'), false, '#collapseOneTwo is not shown')
|
||||
assert.ok($collapseTwoOne.hasClass('show'), '#collapseTwoOne is shown')
|
||||
assert.ok($collapseTwoTwo.hasClass('show'), '#collapseTwoTwo is shown')
|
||||
done()
|
||||
|
|
@ -689,14 +689,14 @@ $(function () {
|
|||
|
||||
$collapseOne.one('shown.bs.collapse', function () {
|
||||
assert.ok($collapseOne.hasClass('show'), '#collapseOne is shown')
|
||||
assert.equal($collapseTwo.hasClass('show'), false, '#collapseTwo is not shown')
|
||||
assert.equal($('#nestedCollapseOne').hasClass('show'), false, '#nestedCollapseOne is not shown')
|
||||
assert.strictEqual($collapseTwo.hasClass('show'), false, '#collapseTwo is not shown')
|
||||
assert.strictEqual($('#nestedCollapseOne').hasClass('show'), false, '#nestedCollapseOne is not shown')
|
||||
$nestedCollapseOne.one('shown.bs.collapse', function () {
|
||||
assert.ok($collapseOne.hasClass('show'), '#collapseOne is shown')
|
||||
assert.equal($collapseTwo.hasClass('show'), false, '#collapseTwo is not shown')
|
||||
assert.strictEqual($collapseTwo.hasClass('show'), false, '#collapseTwo is not shown')
|
||||
assert.ok($nestedCollapseOne.hasClass('show'), '#nestedCollapseOne is shown')
|
||||
$collapseTwo.one('shown.bs.collapse', function () {
|
||||
assert.equal($collapseOne.hasClass('show'), false, '#collapseOne is not shown')
|
||||
assert.strictEqual($collapseOne.hasClass('show'), false, '#collapseOne is not shown')
|
||||
assert.ok($collapseTwo.hasClass('show'), '#collapseTwo is shown')
|
||||
assert.ok($nestedCollapseOne.hasClass('show'), '#nestedCollapseOne is shown')
|
||||
done()
|
||||
|
|
@ -737,13 +737,13 @@ $(function () {
|
|||
var $target2 = $('<div id="test2" class="multi"/>').appendTo('#qunit-fixture')
|
||||
|
||||
$target2.one('shown.bs.collapse', function () {
|
||||
assert.equal($trigger1.hasClass('collapsed'), false, 'trigger1 does not have collapsed class')
|
||||
assert.equal($trigger2.hasClass('collapsed'), false, 'trigger2 does not have collapsed class')
|
||||
assert.equal($trigger3.hasClass('collapsed'), false, 'trigger3 does not have collapsed class')
|
||||
assert.strictEqual($trigger1.hasClass('collapsed'), false, 'trigger1 does not have collapsed class')
|
||||
assert.strictEqual($trigger2.hasClass('collapsed'), false, 'trigger2 does not have collapsed class')
|
||||
assert.strictEqual($trigger3.hasClass('collapsed'), false, 'trigger3 does not have collapsed class')
|
||||
$target2.one('hidden.bs.collapse', function () {
|
||||
assert.equal($trigger1.hasClass('collapsed'), false, 'trigger1 does not have collapsed class')
|
||||
assert.strictEqual($trigger1.hasClass('collapsed'), false, 'trigger1 does not have collapsed class')
|
||||
assert.ok($trigger2.hasClass('collapsed'), 'trigger2 has collapsed class')
|
||||
assert.equal($trigger3.hasClass('collapsed'), false, 'trigger3 does not have collapsed class')
|
||||
assert.strictEqual($trigger3.hasClass('collapsed'), false, 'trigger3 does not have collapsed class')
|
||||
$target1.one('hidden.bs.collapse', function () {
|
||||
assert.ok($trigger1.hasClass('collapsed'), 'trigger1 has collapsed class')
|
||||
assert.ok($trigger2.hasClass('collapsed'), 'trigger2 has collapsed class')
|
||||
|
|
@ -883,7 +883,7 @@ $(function () {
|
|||
|
||||
$collapse2.on('shown.bs.collapse', function () {
|
||||
assert.ok($collapse2.hasClass('show'))
|
||||
assert.equal($('#collapse1').hasClass('show'), false)
|
||||
assert.strictEqual($('#collapse1').hasClass('show'), false)
|
||||
done()
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ $(function () {
|
|||
$(dropdownHTML).appendTo('#qunit-fixture')
|
||||
var $dropdown = $('#qunit-fixture').find('[data-toggle="dropdown"]').bootstrapDropdown()
|
||||
$dropdown.on('click', function () {
|
||||
assert.equal($dropdown.parent('.dropdown').hasClass('show'), false)
|
||||
assert.strictEqual($dropdown.parent('.dropdown').hasClass('show'), false)
|
||||
done()
|
||||
})
|
||||
$dropdown.trigger($.Event('click'))
|
||||
|
|
@ -88,7 +88,7 @@ $(function () {
|
|||
$button.trigger('focus').trigger($.Event('keydown', {
|
||||
which: 27
|
||||
}))
|
||||
assert.equal($dropdown.parent('.dropdown').hasClass('show'), false, 'dropdown menu is not shown after escape pressed')
|
||||
assert.strictEqual($dropdown.parent('.dropdown').hasClass('show'), false, 'dropdown menu is not shown after escape pressed')
|
||||
done()
|
||||
})
|
||||
|
||||
|
|
@ -108,7 +108,7 @@ $(function () {
|
|||
$dropdown
|
||||
.parent('.dropdown')
|
||||
.on('shown.bs.dropdown', function () {
|
||||
assert.equal($dropdown.parent('.dropdown').hasClass('position-static'), false, '"position-static" class not added')
|
||||
assert.strictEqual($dropdown.parent('.dropdown').hasClass('position-static'), false, '"position-static" class not added')
|
||||
done()
|
||||
})
|
||||
$dropdown.trigger('click')
|
||||
|
|
@ -211,7 +211,7 @@ $(function () {
|
|||
$(dropdownHTML).appendTo('#qunit-fixture')
|
||||
var $dropdown = $('#qunit-fixture').find('[data-toggle="dropdown"]').bootstrapDropdown()
|
||||
$dropdown.on('click', function () {
|
||||
assert.equal($dropdown.parent('.dropdown').hasClass('show'), false)
|
||||
assert.strictEqual($dropdown.parent('.dropdown').hasClass('show'), false)
|
||||
done()
|
||||
})
|
||||
$dropdown.trigger($.Event('click'))
|
||||
|
|
@ -266,7 +266,7 @@ $(function () {
|
|||
assert.ok($dropdown.parent('.dropdown').hasClass('show'), '"show" class added on click')
|
||||
$(document.body).trigger('click')
|
||||
}).on('hidden.bs.dropdown', function () {
|
||||
assert.equal($dropdown.parent('.dropdown').hasClass('show'), false, '"show" class removed')
|
||||
assert.strictEqual($dropdown.parent('.dropdown').hasClass('show'), false, '"show" class removed')
|
||||
done()
|
||||
})
|
||||
$dropdown.trigger('click')
|
||||
|
|
@ -298,7 +298,7 @@ $(function () {
|
|||
e.which = 9 // Tab
|
||||
$(document.body).trigger(e)
|
||||
}).on('hidden.bs.dropdown', function () {
|
||||
assert.equal($dropdown.parent('.dropdown').hasClass('show'), false, '"show" class removed')
|
||||
assert.strictEqual($dropdown.parent('.dropdown').hasClass('show'), false, '"show" class removed')
|
||||
done()
|
||||
})
|
||||
$dropdown.trigger('click')
|
||||
|
|
@ -642,8 +642,8 @@ $(function () {
|
|||
$dropdown.trigger($.Event('keydown', {
|
||||
which: 40
|
||||
}))
|
||||
assert.equal($(document.activeElement).is('.disabled'), false, '.disabled is not focused')
|
||||
assert.equal($(document.activeElement).is(':disabled'), false, ':disabled is not focused')
|
||||
assert.strictEqual($(document.activeElement).is('.disabled'), false, '.disabled is not focused')
|
||||
assert.strictEqual($(document.activeElement).is(':disabled'), false, ':disabled is not focused')
|
||||
done()
|
||||
})
|
||||
$dropdown.trigger('click')
|
||||
|
|
@ -807,7 +807,7 @@ $(function () {
|
|||
which: 27
|
||||
}))
|
||||
|
||||
assert.equal($dropdown.parent('.dropdown').hasClass('show'), false, 'dropdown menu was closed after escape')
|
||||
assert.strictEqual($dropdown.parent('.dropdown').hasClass('show'), false, 'dropdown menu was closed after escape')
|
||||
assert.strictEqual($(document.activeElement)[0], $toggle[0], 'toggle has focus again once menu was closed after escape')
|
||||
done()
|
||||
})
|
||||
|
|
@ -877,7 +877,7 @@ $(function () {
|
|||
$input.trigger('focus').trigger($.Event('keydown', {
|
||||
which: 27
|
||||
}))
|
||||
assert.equal($dropdown.parent('.dropdown').hasClass('show'), false, 'dropdown menu is not shown')
|
||||
assert.strictEqual($dropdown.parent('.dropdown').hasClass('show'), false, 'dropdown menu is not shown')
|
||||
done()
|
||||
})
|
||||
|
||||
|
|
@ -924,7 +924,7 @@ $(function () {
|
|||
$input.trigger('focus').trigger($.Event('keydown', {
|
||||
which: 27
|
||||
}))
|
||||
assert.equal($dropdown.parent('.dropdown').hasClass('show'), false, 'dropdown menu is not shown')
|
||||
assert.strictEqual($dropdown.parent('.dropdown').hasClass('show'), false, 'dropdown menu is not shown')
|
||||
|
||||
$dropdown
|
||||
.parent('.dropdown')
|
||||
|
|
@ -992,7 +992,7 @@ $(function () {
|
|||
$textarea.trigger('focus').trigger($.Event('keydown', {
|
||||
which: 27
|
||||
}))
|
||||
assert.equal($dropdown.parent('.dropdown').hasClass('show'), false, 'dropdown menu is not shown')
|
||||
assert.strictEqual($dropdown.parent('.dropdown').hasClass('show'), false, 'dropdown menu is not shown')
|
||||
|
||||
$dropdown
|
||||
.parent('.dropdown')
|
||||
|
|
@ -1284,7 +1284,7 @@ $(function () {
|
|||
assert.ok(true, 'hide was fired')
|
||||
})
|
||||
.on('hidden.bs.dropdown', function () {
|
||||
assert.equal($dropdown.parent('.dropdown').hasClass('show'), false, 'dropdown menu is hidden')
|
||||
assert.strictEqual($dropdown.parent('.dropdown').hasClass('show'), false, 'dropdown menu is hidden')
|
||||
done()
|
||||
})
|
||||
|
||||
|
|
@ -1332,7 +1332,7 @@ $(function () {
|
|||
|
||||
var dropdown = $dropdown.data('bs.dropdown')
|
||||
dropdown.hide()
|
||||
assert.equal($dropdown.parent('.dropdown').hasClass('show'), false, 'dropdown menu is still hidden')
|
||||
assert.strictEqual($dropdown.parent('.dropdown').hasClass('show'), false, 'dropdown menu is still hidden')
|
||||
})
|
||||
|
||||
QUnit.test('should show dropdown', function (assert) {
|
||||
|
|
@ -1395,7 +1395,7 @@ $(function () {
|
|||
})
|
||||
|
||||
dropdown.show()
|
||||
assert.equal($dropdown.parent('.dropdown').hasClass('show'), false, 'dropdown menu is hidden')
|
||||
assert.strictEqual($dropdown.parent('.dropdown').hasClass('show'), false, 'dropdown menu is hidden')
|
||||
})
|
||||
|
||||
QUnit.test('should prevent default event on hide method call', function (assert) {
|
||||
|
|
@ -1441,7 +1441,7 @@ $(function () {
|
|||
$(dropdownHTML).appendTo('#qunit-fixture')
|
||||
var $dropdown = $('#qunit-fixture').find('[data-toggle="dropdown"]').bootstrapDropdown()
|
||||
$dropdown.show()
|
||||
assert.equal($dropdown.parent('.dropdown').hasClass('show'), false)
|
||||
assert.strictEqual($dropdown.parent('.dropdown').hasClass('show'), false)
|
||||
})
|
||||
|
||||
QUnit.test('should not open dropdown via show method if target is disabled via class', function (assert) {
|
||||
|
|
@ -1457,7 +1457,7 @@ $(function () {
|
|||
$(dropdownHTML).appendTo('#qunit-fixture')
|
||||
var $dropdown = $('#qunit-fixture').find('[data-toggle="dropdown"]').bootstrapDropdown()
|
||||
$dropdown.show()
|
||||
assert.equal($dropdown.parent('.dropdown').hasClass('show'), false)
|
||||
assert.strictEqual($dropdown.parent('.dropdown').hasClass('show'), false)
|
||||
})
|
||||
|
||||
QUnit.test('should not hide dropdown via hide method if target is disabled via attribute', function (assert) {
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ $(function () {
|
|||
$(this).bootstrapModal('hide')
|
||||
})
|
||||
.on('hidden.bs.modal', function () {
|
||||
assert.equal($('#modal-test').is(':visible'), false, 'modal hidden')
|
||||
assert.strictEqual($('#modal-test').is(':visible'), false, 'modal hidden')
|
||||
done()
|
||||
})
|
||||
.bootstrapModal('show')
|
||||
|
|
@ -130,7 +130,7 @@ $(function () {
|
|||
$(this).bootstrapModal('toggle')
|
||||
})
|
||||
.on('hidden.bs.modal', function () {
|
||||
assert.equal($('#modal-test').is(':visible'), false, 'modal hidden')
|
||||
assert.strictEqual($('#modal-test').is(':visible'), false, 'modal hidden')
|
||||
done()
|
||||
})
|
||||
.bootstrapModal('toggle')
|
||||
|
|
@ -147,7 +147,7 @@ $(function () {
|
|||
$(this).find('.close').trigger('click')
|
||||
})
|
||||
.on('hidden.bs.modal', function () {
|
||||
assert.equal($('#modal-test').is(':visible'), false, 'modal hidden')
|
||||
assert.strictEqual($('#modal-test').is(':visible'), false, 'modal hidden')
|
||||
done()
|
||||
})
|
||||
.bootstrapModal('toggle')
|
||||
|
|
@ -163,7 +163,7 @@ $(function () {
|
|||
$(this).bootstrapModal('hide')
|
||||
})
|
||||
.on('hidden.bs.modal', function () {
|
||||
assert.equal($('#modal-test').is(':visible'), false, 'modal hidden')
|
||||
assert.strictEqual($('#modal-test').is(':visible'), false, 'modal hidden')
|
||||
done()
|
||||
})
|
||||
.bootstrapModal('show')
|
||||
|
|
@ -181,7 +181,7 @@ $(function () {
|
|||
$('#modal-test').trigger('click')
|
||||
})
|
||||
.on('hidden.bs.modal', function () {
|
||||
assert.equal($('#modal-test').is(':visible'), false, 'modal hidden')
|
||||
assert.strictEqual($('#modal-test').is(':visible'), false, 'modal hidden')
|
||||
done()
|
||||
})
|
||||
.bootstrapModal('show')
|
||||
|
|
@ -214,7 +214,7 @@ $(function () {
|
|||
}))
|
||||
|
||||
setTimeout(function () {
|
||||
assert.equal($('#modal-test').is(':visible'), false, 'modal hidden')
|
||||
assert.strictEqual($('#modal-test').is(':visible'), false, 'modal hidden')
|
||||
$div.remove()
|
||||
done()
|
||||
}, 0)
|
||||
|
|
@ -324,13 +324,13 @@ $(function () {
|
|||
})
|
||||
.one('hidden.bs.modal', function () {
|
||||
// After one open-close cycle
|
||||
assert.equal($('#modal-test').is(':visible'), false, 'modal hidden')
|
||||
assert.strictEqual($('#modal-test').is(':visible'), false, 'modal hidden')
|
||||
$(this)
|
||||
.one('shown.bs.modal', function () {
|
||||
$('#close').trigger('click')
|
||||
})
|
||||
.one('hidden.bs.modal', function () {
|
||||
assert.equal($('#modal-test').is(':visible'), false, 'modal hidden')
|
||||
assert.strictEqual($('#modal-test').is(':visible'), false, 'modal hidden')
|
||||
done()
|
||||
})
|
||||
.bootstrapModal('show')
|
||||
|
|
|
|||
|
|
@ -157,9 +157,9 @@ $(function () {
|
|||
|
||||
assert.notStrictEqual($('.popover').length, 0, 'popover inserted')
|
||||
assert.strictEqual($('.popover .popover-header').text(), '@glebm <3 writing tests', 'title inserted')
|
||||
assert.equal($.contains($('.popover').get(0), title), false, 'title node copied, not moved')
|
||||
assert.strictEqual($.contains($('.popover').get(0), title), false, 'title node copied, not moved')
|
||||
assert.strictEqual($('.popover .popover-body').html(), '¯\\_(ツ)_/¯', 'content inserted')
|
||||
assert.equal($.contains($('.popover').get(0), content), false, 'content node copied, not moved')
|
||||
assert.strictEqual($.contains($('.popover').get(0), content), false, 'content node copied, not moved')
|
||||
})
|
||||
|
||||
QUnit.test('should not duplicate HTML object', function (assert) {
|
||||
|
|
@ -279,7 +279,7 @@ $(function () {
|
|||
$popover.bootstrapPopover('show')
|
||||
$popover.bootstrapPopover('dispose')
|
||||
|
||||
assert.equal($popover.hasClass('show'), false, 'popover is hidden')
|
||||
assert.strictEqual($popover.hasClass('show'), false, 'popover is hidden')
|
||||
assert.strictEqual(typeof $popover.data('popover'), 'undefined', 'popover does not have data')
|
||||
assert.strictEqual($._data($popover[0], 'events').click[0].namespace, 'foo', 'popover still has click.foo')
|
||||
assert.ok(!$._data($popover[0], 'events').mouseover && !$._data($popover[0], 'events').mouseout, 'popover does not have any events')
|
||||
|
|
|
|||
|
|
@ -264,9 +264,9 @@ $(function () {
|
|||
})
|
||||
|
||||
$scrollspy.one('scroll', function () {
|
||||
assert.equal($section.find('#one-link').hasClass('active'), false, '"active" class removed from first section')
|
||||
assert.strictEqual($section.find('#one-link').hasClass('active'), false, '"active" class removed from first section')
|
||||
assert.ok($section.find('#two-link').hasClass('active'), '"active" class on middle section')
|
||||
assert.equal($section.find('#three-link').hasClass('active'), false, '"active" class not on last section')
|
||||
assert.strictEqual($section.find('#three-link').hasClass('active'), false, '"active" class not on last section')
|
||||
done()
|
||||
})
|
||||
|
||||
|
|
|
|||
|
|
@ -372,12 +372,12 @@ $(function () {
|
|||
$(tabsHTML).appendTo('#qunit-fixture')
|
||||
|
||||
$('#tabNested2').on('shown.bs.tab', function () {
|
||||
assert.ok($('#x-tab1').hasClass('active'))
|
||||
assert.strictEqual($('#x-tab1').hasClass('active'), true)
|
||||
done()
|
||||
})
|
||||
|
||||
$('#tab1').on('shown.bs.tab', function () {
|
||||
assert.ok($('#x-tab1').hasClass('active'))
|
||||
assert.strictEqual($('#x-tab1').hasClass('active'), true)
|
||||
$('#tabNested2').trigger($.Event('click'))
|
||||
})
|
||||
.trigger($.Event('click'))
|
||||
|
|
@ -398,15 +398,15 @@ $(function () {
|
|||
$(tabsHTML).appendTo('#qunit-fixture')
|
||||
$('#tab-profile')
|
||||
.on('shown.bs.tab', function () {
|
||||
assert.ok($('#profile').hasClass('fade'))
|
||||
assert.ok($('#profile').hasClass('show'))
|
||||
assert.strictEqual($('#profile').hasClass('fade'), true)
|
||||
assert.strictEqual($('#profile').hasClass('show'), true)
|
||||
|
||||
$('#tab-home')
|
||||
.on('shown.bs.tab', function () {
|
||||
assert.ok($('#profile').hasClass('fade'))
|
||||
assert.notOk($('#profile').hasClass('show'))
|
||||
assert.ok($('#home').hasClass('fade'))
|
||||
assert.ok($('#home').hasClass('show'))
|
||||
assert.strictEqual($('#profile').hasClass('fade'), true)
|
||||
assert.strictEqual($('#profile').hasClass('show'), false)
|
||||
assert.strictEqual($('#home').hasClass('fade'), true)
|
||||
assert.strictEqual($('#home').hasClass('show'), true)
|
||||
|
||||
done()
|
||||
})
|
||||
|
|
|
|||
|
|
@ -170,7 +170,7 @@ $(function () {
|
|||
|
||||
$toast.one('shown.bs.toast', function () {
|
||||
setTimeout(function () {
|
||||
assert.ok($toast.hasClass('show'))
|
||||
assert.strictEqual($toast.hasClass('show'), true)
|
||||
assert.notStrictEqual(typeof $toast.data('bs.toast'), 'undefined')
|
||||
|
||||
$toast.bootstrapToast('dispose')
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ $(function () {
|
|||
|
||||
assert.strictEqual($('#' + id).length, 1, 'has a unique id')
|
||||
assert.strictEqual($('.tooltip').attr('aria-describedby'), $trigger.attr('id'), 'tooltip id and aria-describedby on trigger match')
|
||||
assert.ok($trigger[0].hasAttribute('aria-describedby'), 'trigger has aria-describedby')
|
||||
assert.strictEqual($trigger[0].hasAttribute('aria-describedby'), true, 'trigger has aria-describedby')
|
||||
})
|
||||
|
||||
QUnit.test('should remove aria-describedby from trigger on hide', function (assert) {
|
||||
|
|
@ -85,11 +85,11 @@ $(function () {
|
|||
|
||||
$trigger
|
||||
.one('shown.bs.tooltip', function () {
|
||||
assert.ok($trigger[0].hasAttribute('aria-describedby'), 'trigger has aria-describedby')
|
||||
assert.strictEqual($trigger[0].hasAttribute('aria-describedby'), true, 'trigger has aria-describedby')
|
||||
$trigger.bootstrapTooltip('hide')
|
||||
})
|
||||
.one('hidden.bs.tooltip', function () {
|
||||
assert.equal($trigger[0].hasAttribute('aria-describedby'), false, 'trigger does not have aria-describedby')
|
||||
assert.strictEqual($trigger[0].hasAttribute('aria-describedby'), false, 'trigger does not have aria-describedby')
|
||||
done()
|
||||
})
|
||||
.bootstrapTooltip('show')
|
||||
|
|
@ -118,8 +118,7 @@ $(function () {
|
|||
|
||||
$tooltip
|
||||
.one('shown.bs.tooltip', function () {
|
||||
assert.ok($('.tooltip')
|
||||
.is('.fade.bs-tooltip-bottom.show'), 'has correct classes applied')
|
||||
assert.ok($('.tooltip').is('.fade.bs-tooltip-bottom.show'), 'has correct classes applied')
|
||||
|
||||
$tooltip.bootstrapTooltip('hide')
|
||||
})
|
||||
|
|
@ -165,7 +164,7 @@ $(function () {
|
|||
.one('shown.bs.tooltip', function () {
|
||||
assert.notStrictEqual($('.tooltip').length, 0, 'tooltip inserted')
|
||||
assert.strictEqual($('.tooltip').text(), '<3 writing tests', 'title inserted')
|
||||
assert.equal($.contains($('.tooltip').get(0), title), false, 'title node copied, not moved')
|
||||
assert.strictEqual($.contains($('.tooltip').get(0), title), false, 'title node copied, not moved')
|
||||
done()
|
||||
})
|
||||
.bootstrapTooltip('show')
|
||||
|
|
@ -203,7 +202,7 @@ $(function () {
|
|||
|
||||
$tooltip
|
||||
.one('shown.bs.tooltip', function () {
|
||||
assert.ok($('.tooltip').hasClass('some-class'), 'custom class is present')
|
||||
assert.strictEqual($('.tooltip').hasClass('some-class'), true, 'custom class is present')
|
||||
$tooltip.bootstrapTooltip('hide')
|
||||
})
|
||||
.one('hidden.bs.tooltip', function () {
|
||||
|
|
@ -345,7 +344,7 @@ $(function () {
|
|||
$tooltip.bootstrapTooltip('show')
|
||||
$tooltip.bootstrapTooltip('dispose')
|
||||
|
||||
assert.equal($tooltip.hasClass('show'), false, 'tooltip is hidden')
|
||||
assert.strictEqual($tooltip.hasClass('show'), false, 'tooltip is hidden')
|
||||
assert.strictEqual(typeof $._data($tooltip[0], 'bs.tooltip'), 'undefined', 'tooltip does not have data')
|
||||
assert.strictEqual($._data($tooltip[0], 'events').click[0].namespace, 'foo', 'tooltip still has click.foo')
|
||||
assert.ok(!$._data($tooltip[0], 'events').mouseover && !$._data($tooltip[0], 'events').mouseout, 'tooltip does not have hover events')
|
||||
|
|
@ -478,7 +477,7 @@ $(function () {
|
|||
})
|
||||
.on('inserted.bs.tooltip', function () {
|
||||
var $tooltip = $($(this).data('bs.tooltip').tip)
|
||||
assert.ok($tooltip.hasClass('bs-tooltip-right'))
|
||||
assert.strictEqual($tooltip.hasClass('bs-tooltip-right'), true)
|
||||
assert.strictEqual(typeof $tooltip.attr('style'), 'undefined')
|
||||
$styles.remove()
|
||||
done()
|
||||
|
|
@ -579,7 +578,7 @@ $(function () {
|
|||
})
|
||||
|
||||
setTimeout(function () {
|
||||
assert.equal($('.tooltip').is('.fade.show'), false, '100ms: tooltip is not faded active')
|
||||
assert.strictEqual($('.tooltip').is('.fade.show'), false, '100ms: tooltip is not faded active')
|
||||
}, 100)
|
||||
|
||||
setTimeout(function () {
|
||||
|
|
@ -601,12 +600,12 @@ $(function () {
|
|||
})
|
||||
|
||||
setTimeout(function () {
|
||||
assert.equal($('.tooltip').is('.fade.show'), false, '100ms: tooltip not faded active')
|
||||
assert.strictEqual($('.tooltip').is('.fade.show'), false, '100ms: tooltip not faded active')
|
||||
$tooltip.trigger('mouseout')
|
||||
}, 100)
|
||||
|
||||
setTimeout(function () {
|
||||
assert.equal($('.tooltip').is('.fade.show'), false, '200ms: tooltip not faded active')
|
||||
assert.strictEqual($('.tooltip').is('.fade.show'), false, '200ms: tooltip not faded active')
|
||||
done()
|
||||
}, 200)
|
||||
|
||||
|
|
@ -655,12 +654,12 @@ $(function () {
|
|||
})
|
||||
|
||||
setTimeout(function () {
|
||||
assert.equal($('.tooltip').is('.fade.show'), false, '100ms: tooltip not faded active')
|
||||
assert.strictEqual($('.tooltip').is('.fade.show'), false, '100ms: tooltip not faded active')
|
||||
$tooltip.trigger('mouseout')
|
||||
}, 100)
|
||||
|
||||
setTimeout(function () {
|
||||
assert.equal($('.tooltip').is('.fade.show'), false, '200ms: tooltip not faded active')
|
||||
assert.strictEqual($('.tooltip').is('.fade.show'), false, '200ms: tooltip not faded active')
|
||||
done()
|
||||
}, 200)
|
||||
|
||||
|
|
@ -681,12 +680,12 @@ $(function () {
|
|||
})
|
||||
|
||||
setTimeout(function () {
|
||||
assert.equal($('.tooltip').is('.fade.show'), false, '100ms: tooltip not faded active')
|
||||
assert.strictEqual($('.tooltip').is('.fade.show'), false, '100ms: tooltip not faded active')
|
||||
$tooltip.trigger('mouseout')
|
||||
}, 100)
|
||||
|
||||
setTimeout(function () {
|
||||
assert.equal($('.tooltip').is('.fade.show'), false, '250ms: tooltip not faded active')
|
||||
assert.strictEqual($('.tooltip').is('.fade.show'), false, '250ms: tooltip not faded active')
|
||||
done()
|
||||
}, 250)
|
||||
|
||||
|
|
@ -716,7 +715,7 @@ $(function () {
|
|||
}, 100)
|
||||
|
||||
setTimeout(function () {
|
||||
assert.equal($($tooltip.data('bs.tooltip').tip).is('.show'), false, '200ms: tooltip removed')
|
||||
assert.strictEqual($($tooltip.data('bs.tooltip').tip).is('.show'), false, '200ms: tooltip removed')
|
||||
done()
|
||||
}, 200)
|
||||
}, 0)
|
||||
|
|
@ -838,7 +837,7 @@ $(function () {
|
|||
['mouseenter', 'focusin', 'click', 'click', 'mouseleave', 'focusout']
|
||||
]
|
||||
|
||||
assert.equal(showingTooltip(), false)
|
||||
assert.strictEqual(showingTooltip(), false)
|
||||
|
||||
$.each(tests, function (idx, triggers) {
|
||||
for (var i = 0, len = triggers.length; i < len; i++) {
|
||||
|
|
@ -868,7 +867,7 @@ $(function () {
|
|||
assert.ok(showingTooltip(), 'tooltip is faded in')
|
||||
|
||||
$el.bootstrapTooltip('hide')
|
||||
assert.equal(showingTooltip(), false, 'tooltip was faded out')
|
||||
assert.strictEqual(showingTooltip(), false, 'tooltip was faded out')
|
||||
|
||||
$el.trigger('click')
|
||||
assert.ok(showingTooltip(), 'tooltip is faded in again')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue