diff options
| author | XhmikosR <[email protected]> | 2020-05-08 16:36:20 +0300 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2020-05-12 19:21:36 +0300 |
| commit | 5f79b75ea8a086841f8aa76f1db6d6c830b98465 (patch) | |
| tree | 580d1200a235a6890d1afb07e51fdb3be716cd04 | |
| parent | 195585f5a6ed48735005b088104e9ed45f02700b (diff) | |
| download | bootstrap-5f79b75ea8a086841f8aa76f1db6d6c830b98465.tar.xz bootstrap-5f79b75ea8a086841f8aa76f1db6d6c830b98465.zip | |
tests: switch to strictEqual/notStrictEqual
| -rw-r--r-- | js/tests/unit/alert.js | 2 | ||||
| -rw-r--r-- | js/tests/unit/modal.js | 10 | ||||
| -rw-r--r-- | js/tests/unit/popover.js | 22 | ||||
| -rw-r--r-- | js/tests/unit/tooltip.js | 12 | ||||
| -rw-r--r-- | js/tests/unit/util.js | 8 |
5 files changed, 27 insertions, 27 deletions
diff --git a/js/tests/unit/alert.js b/js/tests/unit/alert.js index 65a8f9e76..0d89d5f53 100644 --- a/js/tests/unit/alert.js +++ b/js/tests/unit/alert.js @@ -56,7 +56,7 @@ $(function () { '</div>' var $alert = $(alertHTML).appendTo('#qunit-fixture').bootstrapAlert() - assert.notEqual($('#qunit-fixture').find('.alert').length, 0, 'element added to dom') + assert.notStrictEqual($('#qunit-fixture').find('.alert').length, 0, 'element added to dom') $alert .one('closed.bs.alert', function () { diff --git a/js/tests/unit/modal.js b/js/tests/unit/modal.js index 14cebe84f..95c334032 100644 --- a/js/tests/unit/modal.js +++ b/js/tests/unit/modal.js @@ -68,7 +68,7 @@ $(function () { $('<div id="modal-test"/>') .on('shown.bs.modal', function () { - assert.notEqual($('#modal-test').length, 0, 'modal inserted into dom') + assert.notStrictEqual($('#modal-test').length, 0, 'modal inserted into dom') done() }) .bootstrapModal('show') @@ -109,7 +109,7 @@ $(function () { $('<div id="modal-test"/>') .on('shown.bs.modal', function () { assert.ok($('#modal-test').is(':visible'), 'modal visible') - assert.notEqual($('#modal-test').length, 0, 'modal inserted into dom') + assert.notStrictEqual($('#modal-test').length, 0, 'modal inserted into dom') $(this).bootstrapModal('hide') }) .on('hidden.bs.modal', function () { @@ -126,7 +126,7 @@ $(function () { $('<div id="modal-test"/>') .on('shown.bs.modal', function () { assert.ok($('#modal-test').is(':visible'), 'modal visible') - assert.notEqual($('#modal-test').length, 0, 'modal inserted into dom') + assert.notStrictEqual($('#modal-test').length, 0, 'modal inserted into dom') $(this).bootstrapModal('toggle') }) .on('hidden.bs.modal', function () { @@ -143,7 +143,7 @@ $(function () { $('<div id="modal-test"><span class="close" data-dismiss="modal"/></div>') .on('shown.bs.modal', function () { assert.ok($('#modal-test').is(':visible'), 'modal visible') - assert.notEqual($('#modal-test').length, 0, 'modal inserted into dom') + assert.notStrictEqual($('#modal-test').length, 0, 'modal inserted into dom') $(this).find('.close').trigger('click') }) .on('hidden.bs.modal', function () { @@ -175,7 +175,7 @@ $(function () { $('<div id="modal-test"><div class="contents"/></div>') .on('shown.bs.modal', function () { - assert.notEqual($('#modal-test').length, 0, 'modal inserted into dom') + assert.notStrictEqual($('#modal-test').length, 0, 'modal inserted into dom') $('.contents').trigger('click') assert.ok($('#modal-test').is(':visible'), 'modal visible') $('#modal-test').trigger('click') diff --git a/js/tests/unit/popover.js b/js/tests/unit/popover.js index f4b04ded5..f4b29cc9e 100644 --- a/js/tests/unit/popover.js +++ b/js/tests/unit/popover.js @@ -51,7 +51,7 @@ $(function () { $('<a href="#" title="mdo" data-content="https://twitter.com/mdo">@mdo</a>') .appendTo('#qunit-fixture') .on('shown.bs.popover', function () { - assert.notEqual($('.popover').length, 0, 'popover was inserted') + assert.notStrictEqual($('.popover').length, 0, 'popover was inserted') $(this).bootstrapPopover('hide') }) .on('hidden.bs.popover', function () { @@ -95,7 +95,7 @@ $(function () { $popover .one('shown.bs.popover', function () { - assert.notEqual($('.popover').length, 0, 'popover was inserted') + assert.notStrictEqual($('.popover').length, 0, 'popover was inserted') assert.strictEqual($('.popover .popover-header').text(), '@fat', 'title correctly inserted') assert.strictEqual($('.popover .popover-body').text(), 'loves writing tests (╯°□°)╯︵ ┻━┻', 'content correctly inserted') $popover.bootstrapPopover('hide') @@ -121,7 +121,7 @@ $(function () { $popover.bootstrapPopover('show') - assert.notEqual($('.popover').length, 0, 'popover inserted') + assert.notStrictEqual($('.popover').length, 0, 'popover inserted') assert.strictEqual($('.popover .popover-header').text(), '@glebm <3 writing tests', 'title inserted') assert.ok($.contains($('.popover').get(0), title), 'title node moved, not copied') // toLowerCase because IE8 will return <I>...</I> @@ -142,7 +142,7 @@ $(function () { $popover.bootstrapPopover('show') - assert.notEqual($('.popover').length, 0, 'popover inserted') + assert.notStrictEqual($('.popover').length, 0, 'popover inserted') assert.strictEqual($('.popover .popover-header').text(), '@glebm <3 writing tests', 'title inserted') assert.ok(!$.contains($('.popover').get(0), title), 'title node copied, not moved') assert.strictEqual($('.popover .popover-body').html(), '¯\\_(ツ)_/¯', 'content inserted') @@ -164,8 +164,8 @@ $(function () { }) function popoverInserted() { - assert.notEqual($('.popover').length, 0, 'popover was inserted') - assert.equal($('.popover .popover-body').html(), $div[0].outerHTML, 'content correctly inserted') + assert.notStrictEqual($('.popover').length, 0, 'popover was inserted') + assert.strictEqual($('.popover .popover-body').html(), $div[0].outerHTML, 'content correctly inserted') } $popover @@ -195,7 +195,7 @@ $(function () { .appendTo('#qunit-fixture') .bootstrapPopover() .one('shown.bs.popover', function () { - assert.notEqual($('.popover').length, 0, 'popover was inserted') + assert.notStrictEqual($('.popover').length, 0, 'popover was inserted') assert.strictEqual($('.popover .popover-header').text(), '@mdo', 'title correctly inserted') assert.strictEqual($('.popover .popover-body').text(), 'loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻', 'content correctly inserted') $popover.bootstrapPopover('hide') @@ -217,7 +217,7 @@ $(function () { content: 'ignored content option' }) .one('shown.bs.popover', function () { - assert.notEqual($('.popover').length, 0, 'popover was inserted') + assert.notStrictEqual($('.popover').length, 0, 'popover was inserted') assert.strictEqual($('.popover .popover-header').text(), '@mdo', 'title correctly inserted') assert.strictEqual($('.popover .popover-body').text(), 'loves data attributes (づ。◕‿‿◕。)づ ︵ ┻━┻', 'content correctly inserted') $popover.bootstrapPopover('hide') @@ -240,7 +240,7 @@ $(function () { template: '<div class="popover foobar"><div class="arrow"></div><div class="inner"><h3 class="title"/><div class="content"><p/></div></div></div>' }) .one('shown.bs.popover', function () { - assert.notEqual($('.popover').length, 0, 'popover was inserted') + assert.notStrictEqual($('.popover').length, 0, 'popover was inserted') assert.ok($('.popover').hasClass('foobar'), 'custom class is present') $popover.bootstrapPopover('hide') }) @@ -282,7 +282,7 @@ $(function () { trigger: 'click' }) .one('shown.bs.popover', function () { - assert.notEqual($('.popover').length, 0, 'popover was inserted') + assert.notStrictEqual($('.popover').length, 0, 'popover was inserted') $div.find('a').trigger('click') }) .one('hidden.bs.popover', function () { @@ -352,7 +352,7 @@ $(function () { $('<a href="#">@Johann-S</a>') .appendTo('#qunit-fixture') .on('inserted.bs.popover', function () { - assert.notEqual($('.popover').length, 0, 'popover was inserted') + assert.notStrictEqual($('.popover').length, 0, 'popover was inserted') assert.ok(true, 'inserted event fired') done() }) diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js index 2149a6891..45c66a7f6 100644 --- a/js/tests/unit/tooltip.js +++ b/js/tests/unit/tooltip.js @@ -141,7 +141,7 @@ $(function () { $tooltip .one('shown.bs.tooltip', function () { - assert.notEqual($('.tooltip b').length, 0, 'b tag was inserted') + assert.notStrictEqual($('.tooltip b').length, 0, 'b tag was inserted') $tooltip.bootstrapTooltip('hide') }) .one('hidden.bs.tooltip', function () { @@ -163,7 +163,7 @@ $(function () { $tooltip .one('shown.bs.tooltip', function () { - assert.notEqual($('.tooltip').length, 0, 'tooltip inserted') + assert.notStrictEqual($('.tooltip').length, 0, 'tooltip inserted') assert.strictEqual($('.tooltip').text(), '<3 writing tests', 'title inserted') assert.ok(!$.contains($('.tooltip').get(0), title), 'title node copied, not moved') done() @@ -184,7 +184,7 @@ $(function () { $tooltip .one('shown.bs.tooltip', function () { - assert.notEqual($('.tooltip').length, 0, 'tooltip inserted') + assert.notStrictEqual($('.tooltip').length, 0, 'tooltip inserted') assert.strictEqual($('.tooltip').text(), '<3 writing tests', 'title inserted') assert.ok($.contains($('.tooltip').get(0), title), 'title node moved, not copied') done() @@ -244,7 +244,7 @@ $(function () { $('<div title="tooltip title"/>') .appendTo('#qunit-fixture') .on('inserted.bs.tooltip', function () { - assert.notEqual($('.tooltip').length, 0, 'tooltip was inserted') + assert.notStrictEqual($('.tooltip').length, 0, 'tooltip was inserted') assert.ok(true, 'inserted event fired') done() }) @@ -403,7 +403,7 @@ $(function () { $tooltip .one('shown.bs.tooltip', function () { - assert.notEqual($('body > .tooltip').length, 0, 'tooltip is direct descendant of body') + assert.notStrictEqual($('body > .tooltip').length, 0, 'tooltip is direct descendant of body') assert.strictEqual($('#qunit-fixture > .tooltip').length, 0, 'tooltip is not in parent') $tooltip.bootstrapTooltip('hide') }) @@ -843,7 +843,7 @@ $(function () { $.each(tests, function (idx, triggers) { for (var i = 0, len = triggers.length; i < len; i++) { $el.trigger(triggers[i]) - assert.equal(i < len - 1, showingTooltip()) + assert.strictEqual(i < len - 1, showingTooltip()) } }) }) diff --git a/js/tests/unit/util.js b/js/tests/unit/util.js index 18a05b269..20c1e6ba3 100644 --- a/js/tests/unit/util.js +++ b/js/tests/unit/util.js @@ -157,9 +157,9 @@ $(function () { mode: 'open' }) - assert.equal(shadowRoot, Util.findShadowRoot(shadowRoot)) + assert.strictEqual(shadowRoot, Util.findShadowRoot(shadowRoot)) shadowRoot.innerHTML = '<button>Shadow Button</button>' - assert.equal(shadowRoot, Util.findShadowRoot(shadowRoot.firstChild)) + assert.strictEqual(shadowRoot, Util.findShadowRoot(shadowRoot.firstChild)) }) QUnit.test('Util.findShadowRoot should return null when attachShadow is not available', function (assert) { @@ -167,7 +167,7 @@ $(function () { var $div = $('<div id="test"></div>').appendTo($('#qunit-fixture')) if (!document.documentElement.attachShadow) { - assert.equal(null, Util.findShadowRoot($div[0])) + assert.strictEqual(null, Util.findShadowRoot($div[0])) } else { var sandbox = sinon.createSandbox() @@ -176,7 +176,7 @@ $(function () { return $div }) - assert.equal(null, Util.findShadowRoot($div[0])) + assert.strictEqual(null, Util.findShadowRoot($div[0])) sandbox.restore() } }) |
