From c10e831ccfe20d0c42b30261eedcf4d2edbb3c05 Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Mon, 23 Nov 2020 18:26:21 +0200 Subject: [PATCH] Auto-fix --- js/tests/unit/alert.js | 6 +-- js/tests/unit/button.js | 62 ++++++++++++++-------------- js/tests/unit/carousel.js | 20 ++++----- js/tests/unit/collapse.js | 60 +++++++++++++-------------- js/tests/unit/dropdown.js | 84 +++++++++++++++++++------------------- js/tests/unit/modal.js | 22 +++++----- js/tests/unit/popover.js | 8 ++-- js/tests/unit/scrollspy.js | 12 +++--- js/tests/unit/toast.js | 12 +++--- js/tests/unit/tooltip.js | 50 +++++++++++------------ js/tests/unit/util.js | 8 ++-- 11 files changed, 172 insertions(+), 172 deletions(-) diff --git a/js/tests/unit/alert.js b/js/tests/unit/alert.js index 0d89d5f53..c0ff5e4fb 100644 --- a/js/tests/unit/alert.js +++ b/js/tests/unit/alert.js @@ -104,18 +104,18 @@ $(function () { var $el = $('
') var $alert = $el.bootstrapAlert() - assert.ok(typeof $alert.data('bs.alert') !== 'undefined') + assert.notStrictEqual(typeof $alert.data('bs.alert'), 'undefined') $alert.data('bs.alert').dispose() - assert.ok(typeof $alert.data('bs.button') === 'undefined') + assert.strictEqual(typeof $alert.data('bs.button'), 'undefined') }) QUnit.test('should return alert version', function (assert) { assert.expect(1) if (typeof Alert !== 'undefined') { - assert.ok(typeof Alert.VERSION === 'string') + assert.strictEqual(typeof Alert.VERSION, 'string') } else { assert.notOk() } diff --git a/js/tests/unit/button.js b/js/tests/unit/button.js index 1bd62b6b8..ebd127148 100644 --- a/js/tests/unit/button.js +++ b/js/tests/unit/button.js @@ -36,7 +36,7 @@ $(function () { QUnit.test('should toggle active', function (assert) { assert.expect(2) var $btn = $('') - assert.ok(!$btn.hasClass('active'), 'btn does not have active class') + assert.equal($btn.hasClass('active'), false, 'btn does not have active class') $btn.bootstrapButton('toggle') assert.ok($btn.hasClass('active'), 'btn has class active') }) @@ -48,7 +48,7 @@ $(function () { $btn .append($inner) .appendTo('#qunit-fixture') - assert.ok(!$btn.hasClass('active'), 'btn does not have active class') + assert.equal($btn.hasClass('active'), false, 'btn does not have active class') $inner.trigger('click') assert.ok($btn.hasClass('active'), 'btn has class active') }) @@ -137,7 +137,7 @@ $(function () { $btn.appendTo('#qunit-fixture') $(window).trigger($.Event('load')) setTimeout(function () { - assert.ok(!$btn.hasClass('active'), 'button without aria-pressed="true" has had active class removed') + assert.equal($btn.hasClass('active'), false, 'button without aria-pressed="true" has had active class removed') done() }, 5) }) @@ -155,7 +155,7 @@ $(function () { $(window).trigger($.Event('load')) setTimeout(function () { - assert.ok(!$btn.hasClass('active'), 'unchecked checkbox button has had active class removed') + assert.equal($btn.hasClass('active'), false, 'unchecked checkbox button has had active class removed') done() }, 5) }) @@ -199,7 +199,7 @@ $(function () { }) setTimeout(function () { - assert.ok(countChangeEvent === 1, 'onchange event fired only once') + assert.strictEqual(countChangeEvent, 1, 'onchange event fired only once') done() }, 5) @@ -226,26 +226,26 @@ $(function () { assert.ok($btn1.hasClass('active'), 'btn1 has active class') assert.ok($btn1.find('input').prop('checked'), 'btn1 is checked') - assert.ok(!$btn2.hasClass('active'), 'btn2 does not have active class') - assert.ok(!$btn2.find('input').prop('checked'), 'btn2 is not checked') + assert.equal($btn2.hasClass('active'), false, 'btn2 does not have active class') + assert.equal($btn2.find('input').prop('checked'), false, 'btn2 is not checked') $btn2.find('input').trigger('click') - assert.ok(!$btn1.hasClass('active'), 'btn1 does not have active class') - assert.ok(!$btn1.find('input').prop('checked'), 'btn1 is not checked') + assert.equal($btn1.hasClass('active'), false, 'btn1 does not have active class') + assert.equal($btn1.find('input').prop('checked'), false, 'btn1 is not checked') assert.ok($btn2.hasClass('active'), 'btn2 has active class') assert.ok($btn2.find('input').prop('checked'), 'btn2 is checked') $btn2.find('input').trigger('click') // Clicking an already checked radio should not un-check it - assert.ok(!$btn1.hasClass('active'), 'btn1 does not have active class') - assert.ok(!$btn1.find('input').prop('checked'), 'btn1 is not checked') + assert.equal($btn1.hasClass('active'), false, 'btn1 does not have active class') + assert.equal($btn1.find('input').prop('checked'), false, 'btn1 is not checked') assert.ok($btn2.hasClass('active'), 'btn2 has active class') assert.ok($btn2.find('input').prop('checked'), 'btn2 is checked') $btn1.bootstrapButton('toggle') assert.ok($btn1.hasClass('active'), 'btn1 has active class') assert.ok($btn1.find('input').prop('checked'), 'btn1 prop is checked') assert.ok($btn1.find('input')[0].checked, 'btn1 is checked with jquery') - assert.ok(!$btn2.hasClass('active'), 'btn2 does not have active class') - assert.ok(!$btn2.find('input').prop('checked'), 'btn2 is not checked') - assert.ok(!$btn2.find('input')[0].checked, 'btn2 is not checked') + assert.equal($btn2.hasClass('active'), false, 'btn2 does not have active class') + assert.equal($btn2.find('input').prop('checked'), false, 'btn2 is not checked') + assert.equal($btn2.find('input')[0].checked, false, 'btn2 is not checked') }) QUnit.test('should fire click event on input', function (assert) { @@ -319,10 +319,10 @@ $(function () { var $input = $btn.children().eq(0) assert.ok($btn.is(':not(.active)'), 'button is initially not active') - assert.ok(!$input.prop('checked'), 'checkbox is initially not checked') + assert.equal($input.prop('checked'), false, 'checkbox is initially not checked') $btn[0].click() // fire a real click on the DOM node itself, not a click() on the jQuery object that just aliases to trigger('click') assert.ok($btn.is(':not(.active)'), 'button did not become active') - assert.ok(!$input.prop('checked'), 'checkbox did not get checked') + assert.equal($input.prop('checked'), false, 'checkbox did not get checked') }) QUnit.test('should not set active class if inner hidden checkbox is disabled but author forgot to set disabled class on outer button', function (assert) { @@ -338,10 +338,10 @@ $(function () { var $input = $btn.children().eq(0) assert.ok($btn.is(':not(.active)'), 'button is initially not active') - assert.ok(!$input.prop('checked'), 'checkbox is initially not checked') + assert.equal($input.prop('checked'), false, 'checkbox is initially not checked') $btn[0].click() // fire a real click on the DOM node itself, not a click() on the jQuery object that just aliases to trigger('click') assert.ok($btn.is(':not(.active)'), 'button did not become active') - assert.ok(!$input.prop('checked'), 'checkbox did not get checked') + assert.equal($input.prop('checked'), false, 'checkbox did not get checked') }) QUnit.test('should correctly set checked state on input and active class on label when using structure', function (assert) { @@ -357,7 +357,7 @@ $(function () { var $input = $label.children().eq(0) assert.ok($label.is(':not(.active)'), 'label is initially not active') - assert.ok(!$input.prop('checked'), 'checkbox is initially not checked') + assert.equal($input.prop('checked'), false, 'checkbox is initially not checked') $label[0].click() // fire a real click on the DOM node itself, not a click() on the jQuery object that just aliases to trigger('click') assert.ok($label.is('.active'), 'label is active after click') assert.ok($input.prop('checked'), 'checkbox is checked after click') @@ -376,7 +376,7 @@ $(function () { var $input = $btn.children().eq(0) assert.ok($btn.is(':not(.active)'), '
is initially not active') - assert.ok(!$input.prop('checked'), 'checkbox is initially not checked') + assert.equal($input.prop('checked'), false, 'checkbox is initially not checked') $btn[0].click() // fire a real click on the DOM node itself, not a click() on the jQuery object that just aliases to trigger('click') assert.ok($btn.is('.active'), '
is active after click') assert.ok($input.prop('checked'), 'checkbox is checked after click') @@ -395,8 +395,8 @@ $(function () { var $input = $btn.children().eq(0) assert.ok($btn.is(':not(.active)'), '