aboutsummaryrefslogtreecommitdiff
path: root/js/tests/unit
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2014-08-23 12:58:24 -0700
committerMark Otto <[email protected]>2014-08-23 12:58:24 -0700
commit875006d08c2e7f48e458fee65327d6c83d4974b1 (patch)
treefd84621b0e842ffaab5d73ee4276b893c5cfd712 /js/tests/unit
parentf265137c0517266206055d306ed41e9456878652 (diff)
parent9c2e54bfeca744ca3d2ab811b23d9a083502c53d (diff)
downloadbootstrap-875006d08c2e7f48e458fee65327d6c83d4974b1.tar.xz
bootstrap-875006d08c2e7f48e458fee65327d6c83d4974b1.zip
Merge pull request #14417 from twbs/fat-14282
fixes #14282 - Already Visible collapse gets closed when …
Diffstat (limited to 'js/tests/unit')
-rw-r--r--js/tests/unit/collapse.js32
1 files changed, 32 insertions, 0 deletions
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 = $('<div id="test1" class="in"/>')
+ .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 = $('<div id="test1" />')
+ .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()