From c44db783bf17c907dd46f53fdaa917ec74ffbded Mon Sep 17 00:00:00 2001 From: Johann-S Date: Wed, 25 Jul 2018 11:29:16 +0200 Subject: chore(update): bump to 4.1.3 --- js/tests/index.html | 2 +- js/tests/karma.conf.js | 8 ++-- js/tests/unit/carousel.js | 25 +++++++------ js/tests/unit/dropdown.js | 67 ++++++++++----------------------- js/tests/unit/modal.js | 85 +++++++++--------------------------------- js/tests/unit/tooltip.js | 4 +- js/tests/visual/alert.html | 2 +- js/tests/visual/carousel.html | 1 + js/tests/visual/collapse.html | 2 +- js/tests/visual/dropdown.html | 2 +- js/tests/visual/modal.html | 2 +- js/tests/visual/popover.html | 2 +- js/tests/visual/scrollspy.html | 3 +- js/tests/visual/tab.html | 2 +- js/tests/visual/tooltip.html | 2 +- 15 files changed, 68 insertions(+), 141 deletions(-) (limited to 'js/tests') diff --git a/js/tests/index.html b/js/tests/index.html index d0ff5b82b..77c29f8f8 100644 --- a/js/tests/index.html +++ b/js/tests/index.html @@ -97,12 +97,12 @@ + - diff --git a/js/tests/karma.conf.js b/js/tests/karma.conf.js index 469a95561..641ac8894 100644 --- a/js/tests/karma.conf.js +++ b/js/tests/karma.conf.js @@ -93,12 +93,12 @@ if (bundle) { reporters.push('BrowserStack') files = files.concat([ 'node_modules/jquery/dist/jquery.slim.min.js', + 'js/coverage/dist/util.js', + 'js/coverage/dist/dom/polyfill.js', 'js/coverage/dist/dom/eventHandler.js', 'js/coverage/dist/dom/selectorEngine.js', 'js/coverage/dist/dom/data.js', 'js/coverage/dist/dom/manipulator.js', - 'js/coverage/dist/util.js', - 'js/coverage/dist/dom/polyfill.js', 'js/coverage/dist/dom/!(polyfill).js', 'js/coverage/dist/tooltip.js', 'js/coverage/dist/!(util|index|tooltip).js', // include all of our js/dist files except util.js, index.js and tooltip.js @@ -115,12 +115,12 @@ if (bundle) { ) files = files.concat([ jqueryFile, + 'js/coverage/dist/util.js', + 'js/coverage/dist/dom/polyfill.js', 'js/coverage/dist/dom/eventHandler.js', 'js/coverage/dist/dom/selectorEngine.js', 'js/coverage/dist/dom/data.js', 'js/coverage/dist/dom/manipulator.js', - 'js/coverage/dist/util.js', - 'js/coverage/dist/dom/polyfill.js', 'js/coverage/dist/dom/!(polyfill).js', 'js/coverage/dist/tooltip.js', 'js/coverage/dist/!(util|index|tooltip).js', // include all of our js/dist files except util.js, index.js and tooltip.js diff --git a/js/tests/unit/carousel.js b/js/tests/unit/carousel.js index 9016f61ab..3db83eaa3 100644 --- a/js/tests/unit/carousel.js +++ b/js/tests/unit/carousel.js @@ -541,16 +541,19 @@ $(function () { '' + '' + '' - var $carousel = $(templateHTML) - $carousel.appendTo('body') + var $carousel = $(templateHTML).appendTo('#qunit-fixture') $carousel.bootstrapCarousel(1) - assert.strictEqual($carousel.data('bs.carousel')._config.interval, 3814) + var carousel = Carousel._getInstance($carousel[0]) + assert.strictEqual(carousel._config.interval, 3814) + carousel.dispose() $carousel.remove() - $carousel.appendTo('body') + $carousel = $carousel.appendTo('#qunit-fixture') $carousel.bootstrapCarousel(2) - assert.strictEqual($carousel.data('bs.carousel')._config.interval, 1814, 'reverts to default interval if no data-interval is set') + carousel = Carousel._getInstance($carousel[0]) + + assert.strictEqual(carousel._config.interval, 1814, 'reverts to default interval if no data-interval is set') $carousel.remove() }) @@ -1080,7 +1083,7 @@ $(function () { var $carousel = $(carouselHTML).appendTo('#qunit-fixture') var $item = $('#item') $carousel.bootstrapCarousel() - var carousel = $carousel.data('bs.carousel') + var carousel = Carousel._getInstance($carousel[0]) var spy = sinon.spy(carousel, 'prev') $carousel.one('slid.bs.carousel', function () { @@ -1122,7 +1125,7 @@ $(function () { $carousel.appendTo('#qunit-fixture') var $item = $('#item') $carousel.bootstrapCarousel() - var carousel = $carousel.data('bs.carousel') + var carousel = Carousel._getInstance($carousel[0]) var spy = sinon.spy(carousel, 'prev') $carousel.one('slid.bs.carousel', function () { @@ -1169,7 +1172,7 @@ $(function () { $carousel.appendTo('#qunit-fixture') var $item = $('#item') $carousel.bootstrapCarousel() - var carousel = $carousel.data('bs.carousel') + var carousel = Carousel._getInstance($carousel[0]) var spy = sinon.spy(carousel, 'next') $carousel.one('slid.bs.carousel', function () { @@ -1212,7 +1215,7 @@ $(function () { $carousel.appendTo('#qunit-fixture') var $item = $('#item') $carousel.bootstrapCarousel() - var carousel = $carousel.data('bs.carousel') + var carousel = Carousel._getInstance($carousel[0]) var spy = sinon.spy(carousel, 'next') $carousel.one('slid.bs.carousel', function () { @@ -1264,7 +1267,7 @@ $(function () { $carousel.appendTo('#qunit-fixture') $carousel.bootstrapCarousel() - var carousel = $carousel.data('bs.carousel') + var carousel = Carousel._getInstance($carousel[0]) var spy = sinon.spy(carousel, '_slide') @@ -1283,7 +1286,7 @@ $(function () { $carousel.appendTo('#qunit-fixture') $carousel.bootstrapCarousel() - var carousel = $carousel.data('bs.carousel') + var carousel = Carousel._getInstance($carousel[0]) var spy = sinon.spy(carousel, 'next') var sandbox = sinon.createSandbox() diff --git a/js/tests/unit/dropdown.js b/js/tests/unit/dropdown.js index a9a5773e6..3c1c9d03d 100644 --- a/js/tests/unit/dropdown.js +++ b/js/tests/unit/dropdown.js @@ -517,7 +517,7 @@ $(function () { $(document.body).trigger('click') }) - $dropdown.trigger('click') + $dropdown[0].click() }) QUnit.test('should fire hide and hidden event without a clickEvent if event type is not click', function (assert) { @@ -547,12 +547,13 @@ $(function () { }) .on('shown.bs.dropdown', function () { assert.ok(true, 'shown was fired') - $dropdown.trigger($.Event('keydown', { - which: 27 - })) + + var keyDown = new Event('keydown') + keyDown.which = 27 + $dropdown[0].dispatchEvent(keyDown) }) - $dropdown.trigger('click') + $dropdown[0].click() }) QUnit.test('should ignore keyboard events within s and