aboutsummaryrefslogtreecommitdiff
path: root/js/tests
diff options
context:
space:
mode:
authorMark Otto <[email protected]>2014-08-23 13:31:56 -0700
committerMark Otto <[email protected]>2014-08-23 13:31:56 -0700
commitf36e1c467c6d3080179de69a15641e9725ce636e (patch)
tree1d30f3580c1fa3e03473df92ddcc1add7242b2b7 /js/tests
parent9a39ee90b4fd4d5b9b6f9a6f2c9d5a29ffeafe92 (diff)
parente3c26407827794df917f6d2d0f378cb5bf7f39e8 (diff)
downloadbootstrap-f36e1c467c6d3080179de69a15641e9725ce636e.tar.xz
bootstrap-f36e1c467c6d3080179de69a15641e9725ce636e.zip
Merge branch 'master' of github.com:twbs/bootstrap
Diffstat (limited to 'js/tests')
-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()