From c096e0e0da1a972bb1088956e0d1dd0fcc88015a Mon Sep 17 00:00:00 2001 From: Johann-S Date: Fri, 4 Jan 2019 16:09:52 +0200 Subject: [PATCH] bump to 4.2.1 --- js/tests/integration/bundle.js | 9 +++++---- js/tests/unit/carousel.js | 4 ++-- js/tests/unit/dropdown.js | 4 ++-- js/tests/unit/tab.js | 6 ++++-- js/tests/unit/toast.js | 2 +- js/tests/unit/tooltip.js | 22 +++++++++++----------- 6 files changed, 25 insertions(+), 22 deletions(-) diff --git a/js/tests/integration/bundle.js b/js/tests/integration/bundle.js index df5b34610d..23caeab732 100644 --- a/js/tests/integration/bundle.js +++ b/js/tests/integration/bundle.js @@ -1,8 +1,9 @@ import 'popper.js' -import $ from 'jquery' import bootstrap from '../../../dist/js/bootstrap' -$(() => { - $('#resultUID').text(bootstrap.Util.getUID('bs')) - $('[data-toggle="tooltip"]').tooltip() +window.addEventListener('load', () => { + document.getElementById('resultUID').innerHTML = bootstrap.Util.getUID('bs') + + bootstrap.Util.makeArray(document.querySelectorAll('[data-toggle="tooltip"]')) + .map((tooltipNode) => new bootstrap.Tooltip(tooltipNode)) }) diff --git a/js/tests/unit/carousel.js b/js/tests/unit/carousel.js index 3db83eaa38..d8f7e6dc0b 100644 --- a/js/tests/unit/carousel.js +++ b/js/tests/unit/carousel.js @@ -1335,13 +1335,13 @@ $(function () { assert.expect(1) var done = assert.async() - var spy = sinon.spy(Carousel, '_jQueryInterface') + var spy = sinon.spy(Carousel, '_carouselInterface') var carouselHTML = '' var $carousel = $(carouselHTML) $carousel.appendTo('#qunit-fixture') - $(window).trigger($.Event('load')) + window.dispatchEvent(new Event('load')) setTimeout(function () { assert.strictEqual(spy.called, true) diff --git a/js/tests/unit/dropdown.js b/js/tests/unit/dropdown.js index 3c1c9d03df..aa52bfe7ab 100644 --- a/js/tests/unit/dropdown.js +++ b/js/tests/unit/dropdown.js @@ -1391,7 +1391,7 @@ $(function () { offset: getOffset }) - var dropdown = $dropdown.data('bs.dropdown') + var dropdown = Dropdown._getInstance($dropdown[0]) var offset = dropdown._getOffset() assert.ok(typeof offset.offset === 'undefined') @@ -1417,7 +1417,7 @@ $(function () { offset: myOffset }) - var dropdown = $dropdown.data('bs.dropdown') + var dropdown = Dropdown._getInstance($dropdown[0]) var offset = dropdown._getOffset() assert.strictEqual(offset.offset, myOffset) diff --git a/js/tests/unit/tab.js b/js/tests/unit/tab.js index 5ea88c46b4..58a225f164 100644 --- a/js/tests/unit/tab.js +++ b/js/tests/unit/tab.js @@ -488,7 +488,8 @@ $(function () { assert.strictEqual($('.show').length, 0) done() }) - .trigger($.Event('click')) + + $('#secondNav')[0].click() }) QUnit.test('should add show class to tab panes if there is a `.fade` class', function (assert) { @@ -516,6 +517,7 @@ $(function () { assert.strictEqual($('.show').length, 1) done() }) - .trigger($.Event('click')) + + $('#secondNav')[0].click() }) }) diff --git a/js/tests/unit/toast.js b/js/tests/unit/toast.js index 07f659a8e8..ffd929646e 100644 --- a/js/tests/unit/toast.js +++ b/js/tests/unit/toast.js @@ -253,7 +253,7 @@ $(function () { var $toast = $(toastHtml) .bootstrapToast() - var toast = $toast.data('bs.toast') + var toast = Toast._getInstance($toast[0]) assert.strictEqual(toast._config.delay, defaultDelay) }) }) diff --git a/js/tests/unit/tooltip.js b/js/tests/unit/tooltip.js index 47425dd57f..4586e4f436 100644 --- a/js/tests/unit/tooltip.js +++ b/js/tests/unit/tooltip.js @@ -1080,7 +1080,7 @@ $(function () { offset: getOffset }) - var tooltip = $trigger.data('bs.tooltip') + var tooltip = Tooltip._getInstance($trigger[0]) var offset = tooltip._getOffset() assert.ok(typeof offset.offset === 'undefined') @@ -1097,7 +1097,7 @@ $(function () { offset: myOffset }) - var tooltip = $trigger.data('bs.tooltip') + var tooltip = Tooltip._getInstance($trigger[0]) var offset = tooltip._getOffset() assert.strictEqual(offset.offset, myOffset) @@ -1113,7 +1113,7 @@ $(function () { sanitize: false }) - var tooltip = $trigger.data('bs.tooltip') + var tooltip = Tooltip._getInstance($trigger[0]) assert.strictEqual(tooltip.config.sanitize, false) }) @@ -1131,7 +1131,7 @@ $(function () { ].join('') }) - var tooltip = $trigger.data('bs.tooltip') + var tooltip = Tooltip._getInstance($trigger[0]) assert.strictEqual(tooltip.config.template.indexOf('script'), -1) }) @@ -1148,7 +1148,7 @@ $(function () { ].join('') }) - var tooltip = $trigger.data('bs.tooltip') + var tooltip = Tooltip._getInstance($trigger[0]) assert.strictEqual(tooltip.config.template.indexOf('onError'), -1) }) @@ -1166,7 +1166,7 @@ $(function () { ].join('') }) - var tooltip = $trigger.data('bs.tooltip') + var tooltip = Tooltip._getInstance($trigger[0]) assert.strictEqual(tooltip.config.template.indexOf('script'), -1) }) @@ -1185,7 +1185,7 @@ $(function () { } }) - var tooltip = $trigger.data('bs.tooltip') + var tooltip = Tooltip._getInstance($trigger[0]) assert.strictEqual(tooltip.config.template.indexOf('