aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit/tab.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/tab.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/tab.js')
-rw-r--r--js/tests/unit/tab.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/js/tests/unit/tab.js b/js/tests/unit/tab.js
index d497de454..551476bac 100644
--- a/js/tests/unit/tab.js
+++ b/js/tests/unit/tab.js
@@ -4,6 +4,7 @@ $(function () {
QUnit.module('tabs plugin')
QUnit.test('should be defined on jquery object', function (assert) {
+ assert.expect(1)
assert.ok($(document.body).tab, 'tabs method is defined')
})
@@ -19,10 +20,12 @@ $(function () {
})
QUnit.test('should provide no conflict', function (assert) {
+ assert.expect(1)
assert.strictEqual($.fn.tab, undefined, 'tab 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 $tab = $el.bootstrapTab()
assert.ok($tab instanceof $, 'returns jquery collection')
@@ -30,6 +33,7 @@ $(function () {
})
QUnit.test('should activate element by tab id', function (assert) {
+ assert.expect(2)
var tabsHTML = '<ul class="tabs">'
+ '<li><a href="#home">Home</a></li>'
+ '<li><a href="#profile">Profile</a></li>'
@@ -45,6 +49,7 @@ $(function () {
})
QUnit.test('should activate element by tab id', function (assert) {
+ assert.expect(2)
var pillsHTML = '<ul class="pills">'
+ '<li><a href="#home">Home</a></li>'
+ '<li><a href="#profile">Profile</a></li>'
@@ -60,6 +65,7 @@ $(function () {
})
QUnit.test('should not fire shown when show is prevented', function (assert) {
+ assert.expect(1)
var done = assert.async()
$('<div class="tab"/>')
@@ -75,6 +81,7 @@ $(function () {
})
QUnit.test('show and shown events should reference correct relatedTarget', function (assert) {
+ assert.expect(2)
var done = assert.async()
var dropHTML = '<ul class="drop">'
@@ -102,6 +109,7 @@ $(function () {
})
QUnit.test('should fire hide and hidden events', function (assert) {
+ assert.expect(2)
var done = assert.async()
var tabsHTML = '<ul class="tabs">'
@@ -132,6 +140,7 @@ $(function () {
})
QUnit.test('should not fire hidden when hide is prevented', function (assert) {
+ assert.expect(1)
var done = assert.async()
var tabsHTML = '<ul class="tabs">'
@@ -156,6 +165,7 @@ $(function () {
})
QUnit.test('hide and hidden events contain correct relatedTarget', function (assert) {
+ assert.expect(2)
var done = assert.async()
var tabsHTML = '<ul class="tabs">'
@@ -179,6 +189,7 @@ $(function () {
})
QUnit.test('selected tab should have aria-expanded', function (assert) {
+ assert.expect(8)
var tabsHTML = '<ul class="nav nav-tabs">'
+ '<li class="active"><a href="#home" toggle="tab" aria-expanded="true">Home</a></li>'
+ '<li><a href="#profile" toggle="tab" aria-expanded="false">Profile</a></li>'