From bdab9486703fd1ed69d2d5db2d7c42de8750d82f Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Fri, 27 Nov 2020 14:27:35 +0200 Subject: [PATCH] Remove unneeded conditional --- js/tests/unit/alert.js | 8 +++----- js/tests/unit/button.js | 8 +++----- js/tests/unit/toast.js | 4 +--- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/js/tests/unit/alert.js b/js/tests/unit/alert.js index 5fbb7e5988..990905fc37 100644 --- a/js/tests/unit/alert.js +++ b/js/tests/unit/alert.js @@ -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') }) }) diff --git a/js/tests/unit/button.js b/js/tests/unit/button.js index 8dd0cfb3f7..cb0d5d70d7 100644 --- a/js/tests/unit/button.js +++ b/js/tests/unit/button.js @@ -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') }) }) diff --git a/js/tests/unit/toast.js b/js/tests/unit/toast.js index 4c06be4f4c..aa8c490b17 100644 --- a/js/tests/unit/toast.js +++ b/js/tests/unit/toast.js @@ -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')