aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit/affix.js
diff options
context:
space:
mode:
authorChris Rebert <[email protected]>2015-02-23 21:55:07 -0800
committerChris Rebert <[email protected]>2015-02-23 22:14:11 -0800
commit7c19fee3f1f3a371445981cf7e88a3af92f3b602 (patch)
tree5b42d0b2764da26da547b56fcf33d32465d2830b /js/tests/unit/affix.js
parent1cbbeef47c696fc4f389cd0df900cf6213ed327d (diff)
downloadbootstrap-7c19fee3f1f3a371445981cf7e88a3af92f3b602.tar.xz
bootstrap-7c19fee3f1f3a371445981cf7e88a3af92f3b602.zip
JS unit tests: use modern QUnit assert object everywhere
Diffstat (limited to 'js/tests/unit/affix.js')
-rw-r--r--js/tests/unit/affix.js24
1 files changed, 12 insertions, 12 deletions
diff --git a/js/tests/unit/affix.js b/js/tests/unit/affix.js
index 040fe9803..480e1adc1 100644
--- a/js/tests/unit/affix.js
+++ b/js/tests/unit/affix.js
@@ -3,8 +3,8 @@ $(function () {
module('affix plugin')
- test('should be defined on jquery object', function () {
- ok($(document.body).affix, 'affix method is defined')
+ test('should be defined on jquery object', function (assert) {
+ assert.ok($(document.body).affix, 'affix method is defined')
})
module('affix', {
@@ -18,21 +18,21 @@ $(function () {
}
})
- test('should provide no conflict', function () {
- strictEqual($.fn.affix, undefined, 'affix was set back to undefined (org value)')
+ test('should provide no conflict', function (assert) {
+ assert.strictEqual($.fn.affix, undefined, 'affix was set back to undefined (org value)')
})
- test('should return jquery collection containing the element', function () {
+ test('should return jquery collection containing the element', function (assert) {
var $el = $('<div/>')
var $affix = $el.bootstrapAffix()
- ok($affix instanceof $, 'returns jquery collection')
- strictEqual($affix[0], $el[0], 'collection contains element')
+ assert.ok($affix instanceof $, 'returns jquery collection')
+ assert.strictEqual($affix[0], $el[0], 'collection contains element')
})
- test('should exit early if element is not visible', function () {
+ test('should exit early if element is not visible', function (assert) {
var $affix = $('<div style="display: none"/>').bootstrapAffix()
$affix.data('bs.affix').checkPosition()
- ok(!$affix.hasClass('affix'), 'affix class was not added')
+ assert.ok(!$affix.hasClass('affix'), 'affix class was not added')
})
test('should trigger affixed event after affix', function (assert) {
@@ -53,9 +53,9 @@ $(function () {
$('#affixTarget')
.on('affix.bs.affix', function () {
- ok(true, 'affix event fired')
+ assert.ok(true, 'affix event fired')
}).on('affixed.bs.affix', function () {
- ok(true, 'affixed event fired')
+ assert.ok(true, 'affixed event fired')
$('#affixTarget, #affixAfter').remove()
done()
})
@@ -85,7 +85,7 @@ $(function () {
offset: { top: 120, bottom: 0 }
})
.on('affixed-top.bs.affix', function () {
- ok($('#affixTopTarget').hasClass('affix-top'), 'affix-top class applied')
+ assert.ok($('#affixTopTarget').hasClass('affix-top'), 'affix-top class applied')
$('#padding-offset').remove()
done()
})