diff options
| author | Alessandro Chitolina <[email protected]> | 2017-09-26 10:04:31 +0200 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2019-02-20 22:05:45 +0200 |
| commit | 7f08061eca035d8f75651e9c3c32503e91f86fae (patch) | |
| tree | 1fcc2e4b252774265df7788359a6d2f509ddd594 /js/tests | |
| parent | 90261b484c7637407b310acecdfe56093738800d (diff) | |
| download | bootstrap-7f08061eca035d8f75651e9c3c32503e91f86fae.tar.xz bootstrap-7f08061eca035d8f75651e9c3c32503e91f86fae.zip | |
rewritten tab without jquery
Diffstat (limited to 'js/tests')
| -rw-r--r-- | js/tests/unit/tab.js | 15 | ||||
| -rw-r--r-- | js/tests/visual/tab.html | 3 |
2 files changed, 12 insertions, 6 deletions
diff --git a/js/tests/unit/tab.js b/js/tests/unit/tab.js index 4491e1494..00dcac18f 100644 --- a/js/tests/unit/tab.js +++ b/js/tests/unit/tab.js @@ -320,7 +320,7 @@ $(function () { '</ul>' var $tabs = $(tabsHTML).appendTo('#qunit-fixture') - $tabs.find('li:last-child a').trigger('click') + EventHandler.trigger($tabs.find('li:last-child a')[0], 'click') assert.notOk($tabs.find('li:first-child a').hasClass('active')) assert.ok($tabs.find('li:last-child a').hasClass('active')) }) @@ -339,7 +339,7 @@ $(function () { '</ul>' var $tabs = $(tabsHTML).appendTo('#qunit-fixture') - $tabs.find('li:first-child a').trigger('click') + EventHandler.trigger($tabs.find('li:first-child a')[0], 'click') assert.ok($tabs.find('li:first-child a').hasClass('active')) assert.notOk($tabs.find('li:last-child a').hasClass('active')) assert.notOk($tabs.find('li:last-child .dropdown-menu a:first-child').hasClass('active')) @@ -378,9 +378,10 @@ $(function () { $('#tab1').on('shown.bs.tab', function () { assert.ok($('#x-tab1').hasClass('active')) - $('#tabNested2').trigger($.Event('click')) + EventHandler.trigger($('#tabNested2')[0], 'click') }) - .trigger($.Event('click')) + + EventHandler.trigger($('#tab1')[0], 'click') }) QUnit.test('should not remove fade class if no active pane is present', function (assert) { @@ -410,9 +411,11 @@ $(function () { done() }) - .trigger($.Event('click')) + + EventHandler.trigger($('#tab-home')[0], 'click') }) - .trigger($.Event('click')) + + EventHandler.trigger($('#tab-profile')[0], 'click') }) QUnit.test('should handle removed tabs', function (assert) { diff --git a/js/tests/visual/tab.html b/js/tests/visual/tab.html index 3b8ce4026..78e573403 100644 --- a/js/tests/visual/tab.html +++ b/js/tests/visual/tab.html @@ -227,7 +227,10 @@ <script src="../../../node_modules/jquery/dist/jquery.slim.min.js"></script> <script src="../../../node_modules/popper.js/dist/umd/popper.min.js"></script> + <script src="../../dist/dom/data.js"></script> <script src="../../dist/dom/eventHandler.js"></script> + <script src="../../dist/dom/manipulator.js"></script> + <script src="../../dist/dom/selectorEngine.js"></script> <script src="../../dist/util.js"></script> <script src="../../dist/tab.js"></script> <script src="../../dist/dropdown.js"></script> |
