]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
tests: add tests for plugins version. (#28366)
authorXhmikosR <xhmikosr@gmail.com>
Wed, 27 Feb 2019 11:20:25 +0000 (13:20 +0200)
committerGitHub <noreply@github.com>
Wed, 27 Feb 2019 11:20:25 +0000 (13:20 +0200)
js/tests/unit/alert.js
js/tests/unit/button.js
js/tests/unit/carousel.js
js/tests/unit/collapse.js
js/tests/unit/dropdown.js
js/tests/unit/modal.js
js/tests/unit/popover.js
js/tests/unit/scrollspy.js
js/tests/unit/tab.js
js/tests/unit/tooltip.js

index 17d7be01eb9f0750b99e4deb2d2f5374e3f55d67..4fa9ca19f7fb734287dcd03673ab91df31fc9f0d 100644 (file)
@@ -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')
   })
 })
index a1d15116b1eb8c3de4362c2d6b43c36c3804e57f..bd393078ba1125b2acef7c11173b44a4a6718f14 100644 (file)
@@ -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')
   })
 })
index d8f7e6dc0b1bfea0b9f4f1c6a023d044c23ac970..a45ef4564ca517b159555ce4ad8f37e87da4e718 100644 (file)
@@ -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')
   })
 
index c59af20624fb9e09fdf6bf7096962a00fa1fd30c..b21c18b8ec9fa18fe879040b337eb67c74688118 100644 (file)
@@ -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')
+  })
 })
index aa52bfe7abac29e14ea8e5bcd7d8a17bbbbdf486..d1f13c8eec3f993c9b96657db21d5f8bfd7d323a 100644 (file)
@@ -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')
+  })
 })
index 6939c5e5bfb30b689aa0cc03137fb57fca852205..6025a65708ff9def594af383d11b9f52de355b74 100644 (file)
@@ -796,4 +796,9 @@ $(function () {
     })
       .bootstrapModal('show')
   })
+
+  QUnit.test('should return the version', function (assert) {
+    assert.expect(1)
+    assert.strictEqual(typeof Modal.VERSION, 'string')
+  })
 })
index bc94a179784f45737ba9c28abc3ae51d24cc080b..ac5c5475730bbc7ce503ac7793e9e4b3695c37fd 100644 (file)
@@ -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')
+  })
 })
index cf053973018f3ac7e2c436e6316f7b5331be0d6d..1530676998c31e7821395d6da7d03e00626ee199 100644 (file)
@@ -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')
+  })
 })
index 58a225f16484f852b2b90d6c326e7e67e20c8127..114e97610039077a92e4ec8436376542d1709fe6 100644 (file)
@@ -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')
+  })
 })
index b542cbfb19afa287d5d5dc498c1f6bbcf4a55476..3bc91046b4f4722b39b22998f5054e1b4c795063 100644 (file)
@@ -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')
+  })
 })