aboutsummaryrefslogtreecommitdiff
path: root/js/tests
diff options
context:
space:
mode:
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()