aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXhmikosR <[email protected]>2019-02-27 13:20:25 +0200
committerGitHub <[email protected]>2019-02-27 13:20:25 +0200
commit9cbd041f6b0b24db4feadc08a4ab967512bd448a (patch)
tree7e53b412494460e755dd1fdb81e603b7b98cbff8
parentbc60a22a1843928814099ef5e6e26552f55aebae (diff)
downloadbootstrap-9cbd041f6b0b24db4feadc08a4ab967512bd448a.tar.xz
bootstrap-9cbd041f6b0b24db4feadc08a4ab967512bd448a.zip
tests: add tests for plugins version. (#28366)
-rw-r--r--js/tests/unit/alert.js9
-rw-r--r--js/tests/unit/button.js9
-rw-r--r--js/tests/unit/carousel.js3
-rw-r--r--js/tests/unit/collapse.js5
-rw-r--r--js/tests/unit/dropdown.js5
-rw-r--r--js/tests/unit/modal.js5
-rw-r--r--js/tests/unit/popover.js5
-rw-r--r--js/tests/unit/scrollspy.js5
-rw-r--r--js/tests/unit/tab.js7
-rw-r--r--js/tests/unit/tooltip.js5
10 files changed, 42 insertions, 16 deletions
diff --git a/js/tests/unit/alert.js b/js/tests/unit/alert.js
index 17d7be01e..4fa9ca19f 100644
--- a/js/tests/unit/alert.js
+++ b/js/tests/unit/alert.js
@@ -116,13 +116,8 @@ $(function () {
assert.ok(Alert._getInstance($alert[0]) === null)
})
- QUnit.test('should return alert version', function (assert) {
+ QUnit.test('should return the version', function (assert) {
assert.expect(1)
-
- if (typeof Alert !== 'undefined') {
- assert.ok(typeof Alert.VERSION === 'string')
- } else {
- assert.notOk()
- }
+ assert.strictEqual(typeof Alert.VERSION, 'string')
})
})
diff --git a/js/tests/unit/button.js b/js/tests/unit/button.js
index a1d15116b..bd393078b 100644
--- a/js/tests/unit/button.js
+++ b/js/tests/unit/button.js
@@ -218,13 +218,8 @@ $(function () {
assert.ok(Button._getInstance($button[0]) === null)
})
- QUnit.test('should return button version', function (assert) {
+ QUnit.test('should return the version', function (assert) {
assert.expect(1)
-
- if (typeof Button !== 'undefined') {
- assert.ok(typeof Button.VERSION === 'string')
- } else {
- assert.notOk()
- }
+ assert.strictEqual(typeof Button.VERSION, 'string')
})
})
diff --git a/js/tests/unit/carousel.js b/js/tests/unit/carousel.js
index d8f7e6dc0..a45ef4564 100644
--- a/js/tests/unit/carousel.js
+++ b/js/tests/unit/carousel.js
@@ -46,9 +46,8 @@ $(function () {
assert.strictEqual(typeof $.fn.carousel, 'undefined', 'carousel was set back to undefined (orig value)')
})
- QUnit.test('should return version', function (assert) {
+ QUnit.test('should return the version', function (assert) {
assert.expect(1)
-
assert.strictEqual(typeof Carousel.VERSION, 'string')
})
diff --git a/js/tests/unit/collapse.js b/js/tests/unit/collapse.js
index c59af2062..b21c18b8e 100644
--- a/js/tests/unit/collapse.js
+++ b/js/tests/unit/collapse.js
@@ -897,4 +897,9 @@ $(function () {
$collapse2.bootstrapCollapse('toggle')
})
+
+ QUnit.test('should return the version', function (assert) {
+ assert.expect(1)
+ assert.strictEqual(typeof Collapse.VERSION, 'string')
+ })
})
diff --git a/js/tests/unit/dropdown.js b/js/tests/unit/dropdown.js
index aa52bfe7a..d1f13c8ee 100644
--- a/js/tests/unit/dropdown.js
+++ b/js/tests/unit/dropdown.js
@@ -1423,4 +1423,9 @@ $(function () {
assert.strictEqual(offset.offset, myOffset)
assert.ok(typeof offset.fn === 'undefined')
})
+
+ QUnit.test('should return the version', function (assert) {
+ assert.expect(1)
+ assert.strictEqual(typeof Dropdown.VERSION, 'string')
+ })
})
diff --git a/js/tests/unit/modal.js b/js/tests/unit/modal.js
index 6939c5e5b..6025a6570 100644
--- a/js/tests/unit/modal.js
+++ b/js/tests/unit/modal.js
@@ -796,4 +796,9 @@ $(function () {
})
.bootstrapModal('show')
})
+
+ QUnit.test('should return the version', function (assert) {
+ assert.expect(1)
+ assert.strictEqual(typeof Modal.VERSION, 'string')
+ })
})
diff --git a/js/tests/unit/popover.js b/js/tests/unit/popover.js
index bc94a1797..ac5c54757 100644
--- a/js/tests/unit/popover.js
+++ b/js/tests/unit/popover.js
@@ -466,4 +466,9 @@ $(function () {
$popover[0].click()
})
+
+ QUnit.test('should return the version', function (assert) {
+ assert.expect(1)
+ assert.strictEqual(typeof Popover.VERSION, 'string')
+ })
})
diff --git a/js/tests/unit/scrollspy.js b/js/tests/unit/scrollspy.js
index cf0539730..153067699 100644
--- a/js/tests/unit/scrollspy.js
+++ b/js/tests/unit/scrollspy.js
@@ -727,4 +727,9 @@ $(function () {
testOffsetMethod('js')
testOffsetMethod('data')
})
+
+ QUnit.test('should return the version', function (assert) {
+ assert.expect(1)
+ assert.strictEqual(typeof ScrollSpy.VERSION, 'string')
+ })
})
diff --git a/js/tests/unit/tab.js b/js/tests/unit/tab.js
index 58a225f16..114e97610 100644
--- a/js/tests/unit/tab.js
+++ b/js/tests/unit/tab.js
@@ -1,6 +1,8 @@
$(function () {
'use strict'
+ var Tab = typeof window.bootstrap !== 'undefined' ? window.bootstrap.Tab : window.Tab
+
QUnit.module('tabs plugin')
QUnit.test('should be defined on jquery object', function (assert) {
@@ -520,4 +522,9 @@ $(function () {
$('#secondNav')[0].click()
})
+
+ QUnit.test('should return the version', function (assert) {
+ assert.expect(1)
+ assert.strictEqual(typeof Tab.VERSION, 'string')
+ })
})
diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js
index b542cbfb1..3bc91046b 100644
--- a/js/tests/unit/tooltip.js
+++ b/js/tests/unit/tooltip.js
@@ -1249,4 +1249,9 @@ $(function () {
assert.strictEqual(tooltip.config.sanitize, true)
})
+
+ QUnit.test('should return the version', function (assert) {
+ assert.expect(1)
+ assert.strictEqual(typeof Tooltip.VERSION, 'string')
+ })
})