From 9c2e54bfeca744ca3d2ab811b23d9a083502c53d Mon Sep 17 00:00:00 2001 From: fat Date: Mon, 18 Aug 2014 19:58:19 -0700 Subject: fixes #14282 - Already Visible collapse gets closed when .collapse('show') is called --- js/tests/unit/collapse.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'js/tests') diff --git a/js/tests/unit/collapse.js b/js/tests/unit/collapse.js index 8e6bb8273..ffa8f7e6d 100644 --- a/js/tests/unit/collapse.js +++ b/js/tests/unit/collapse.js @@ -102,6 +102,38 @@ $(function () { $target.click() }) + test('should not close a collapse when initialized with "show" if already shown', function () { + stop() + + expect(0) + + var $test = $('
') + .appendTo('#qunit-fixture') + .on('hide.bs.collapse', function () { + ok(false) + }) + + $test.bootstrapCollapse('show') + + setTimeout(start, 0) + }) + + test('should open a collapse when initialized with "show" if not already shown', function () { + stop() + + expect(1) + + var $test = $('
') + .appendTo('#qunit-fixture') + .on('show.bs.collapse', function () { + ok(true) + }) + + $test.bootstrapCollapse('show') + + setTimeout(start, 0) + }) + test('should remove "collapsed" class from active accordion target', function () { stop() -- cgit v1.2.3