]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Remove unneeded conditional
authorXhmikosR <xhmikosr@gmail.com>
Fri, 27 Nov 2020 12:27:35 +0000 (14:27 +0200)
committerXhmikosR <xhmikosr@gmail.com>
Wed, 15 Sep 2021 12:44:20 +0000 (15:44 +0300)
js/tests/unit/alert.js
js/tests/unit/button.js
js/tests/unit/toast.js

index 5fbb7e5988d3bc3105e08e3be4ca48d99963d9b2..990905fc37246c0eb7c6eda462b1deb4f7027b9d 100644 (file)
@@ -1,6 +1,8 @@
 $(function () {
   'use strict'
 
+  window.Alert = typeof bootstrap !== 'undefined' ? bootstrap.Alert : Alert
+
   QUnit.module('alert plugin')
 
   QUnit.test('should be defined on jquery object', function (assert) {
@@ -114,10 +116,6 @@ $(function () {
   QUnit.test('should return alert version', function (assert) {
     assert.expect(1)
 
-    if (typeof Alert !== 'undefined') {
-      assert.strictEqual(typeof Alert.VERSION, 'string')
-    } else {
-      assert.notOk()
-    }
+    assert.strictEqual(typeof Alert.VERSION, 'string')
   })
 })
index 8dd0cfb3f7ba88701f91e1c6ee109c51f4f4d872..cb0d5d70d7dc57edaa5f98b4e797ef488d6aca79 100644 (file)
@@ -1,6 +1,8 @@
 $(function () {
   'use strict'
 
+  window.Button = typeof bootstrap !== 'undefined' ? bootstrap.Button : Button
+
   QUnit.module('button plugin')
 
   QUnit.test('should be defined on jquery object', function (assert) {
@@ -472,10 +474,6 @@ $(function () {
   QUnit.test('should return button version', function (assert) {
     assert.expect(1)
 
-    if (typeof Button !== 'undefined') {
-      assert.strictEqual(typeof Button.VERSION, 'string')
-    } else {
-      assert.notOk()
-    }
+    assert.strictEqual(typeof Button.VERSION, 'string')
   })
 })
index 4c06be4f4c9bccaa04570c1fd072e058c7a7f64c..aa8c490b17f0673a9481e64e08f4c62d6fcf05e0 100644 (file)
@@ -1,9 +1,7 @@
 $(function () {
   'use strict'
 
-  if (typeof bootstrap !== 'undefined') {
-    window.Toast = bootstrap.Toast
-  }
+  window.Toast = typeof bootstrap !== 'undefined' ? bootstrap.Toast : Toast
 
   QUnit.module('toast plugin')