aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit/scrollspy.js
diff options
context:
space:
mode:
authorKevin Kirsche <[email protected]>2015-03-01 09:33:48 -0500
committerKevin Kirsche <[email protected]>2015-03-03 08:45:07 -0500
commit4febcb4b492c322c71bdef579cc4ad99ea86e150 (patch)
tree03eed0d888df8e56e40616f1fa3e1ada3928a7d8 /js/tests/unit/scrollspy.js
parent4311e09b04763bd4efd20212dbee8c6c95df56dc (diff)
downloadbootstrap-4febcb4b492c322c71bdef579cc4ad99ea86e150.tar.xz
bootstrap-4febcb4b492c322c71bdef579cc4ad99ea86e150.zip
[Fixes #15953] Implement assert.expect in each unit test
[Fixes #15953] Implement `assert.expect` in each unit test
Diffstat (limited to 'js/tests/unit/scrollspy.js')
-rw-r--r--js/tests/unit/scrollspy.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/js/tests/unit/scrollspy.js b/js/tests/unit/scrollspy.js
index 0fca144b6..fe80e57b7 100644
--- a/js/tests/unit/scrollspy.js
+++ b/js/tests/unit/scrollspy.js
@@ -4,6 +4,7 @@ $(function () {
QUnit.module('scrollspy plugin')
QUnit.test('should be defined on jquery object', function (assert) {
+ assert.expect(1)
assert.ok($(document.body).scrollspy, 'scrollspy method is defined')
})
@@ -19,10 +20,12 @@ $(function () {
})
QUnit.test('should provide no conflict', function (assert) {
+ assert.expect(1)
assert.strictEqual($.fn.scrollspy, undefined, 'scrollspy was set back to undefined (org value)')
})
QUnit.test('should return jquery collection containing the element', function (assert) {
+ assert.expect(2)
var $el = $('<div/>')
var $scrollspy = $el.bootstrapScrollspy()
assert.ok($scrollspy instanceof $, 'returns jquery collection')
@@ -30,6 +33,7 @@ $(function () {
})
QUnit.test('should only switch "active" class on current target', function (assert) {
+ assert.expect(1)
var done = assert.async()
var sectionHTML = '<div id="root" class="active">'
@@ -74,6 +78,7 @@ $(function () {
})
QUnit.test('should correctly select middle navigation option when large offset is used', function (assert) {
+ assert.expect(3)
var done = assert.async()
var sectionHTML = '<div id="header" style="height: 500px;"></div>'
@@ -107,6 +112,7 @@ $(function () {
})
QUnit.test('should add the active class to the correct element', function (assert) {
+ assert.expect(2)
var navbarHtml =
'<nav class="navbar">'
+ '<ul class="nav">'
@@ -143,6 +149,7 @@ $(function () {
})
QUnit.test('should add the active class correctly when there are nested elements at 0 scroll offset', function (assert) {
+ assert.expect(6)
var times = 0
var done = assert.async()
var navbarHtml = '<nav id="navigation" class="navbar">'
@@ -181,6 +188,7 @@ $(function () {
})
QUnit.test('should clear selection if above the first section', function (assert) {
+ assert.expect(3)
var done = assert.async()
var sectionHTML = '<div id="header" style="height: 500px;"></div>'