From 80d4a51e79b951f11f61ed7a302d331b7942c920 Mon Sep 17 00:00:00 2001 From: Alessandro Chitolina Date: Sat, 25 Nov 2017 16:07:41 +0100 Subject: tab.js: do not remove fade class if there's no initial active pane --- js/tests/unit/tab.js | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'js/tests/unit') diff --git a/js/tests/unit/tab.js b/js/tests/unit/tab.js index c26f07600..ee88bad30 100644 --- a/js/tests/unit/tab.js +++ b/js/tests/unit/tab.js @@ -382,4 +382,37 @@ $(function () { }) .trigger($.Event('click')) }) + + QUnit.test('should not remove fade class if no active pane is present', function (assert) { + assert.expect(6) + var done = assert.async() + var tabsHTML = '' + + '
' + + '
' + + '
' + + '
' + + + $(tabsHTML).appendTo('#qunit-fixture') + $('#tab-profile') + .on('shown.bs.tab', function () { + assert.ok($('#profile').hasClass('fade')) + assert.ok($('#profile').hasClass('show')) + + $('#tab-home') + .on('shown.bs.tab', function () { + assert.ok($('#profile').hasClass('fade')) + assert.notOk($('#profile').hasClass('show')) + assert.ok($('#home').hasClass('fade')) + assert.ok($('#home').hasClass('show')) + + done() + }) + .trigger($.Event('click')) + }) + .trigger($.Event('click')) + }) }) -- cgit v1.2.3