From 9bc7de93950444eee1e4cae8b5a029bcb4907640 Mon Sep 17 00:00:00 2001 From: Johann-S Date: Mon, 11 Jan 2016 20:42:35 +0100 Subject: Fix bug multiple accordions collapse --- js/tests/unit/collapse.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'js/tests') diff --git a/js/tests/unit/collapse.js b/js/tests/unit/collapse.js index 892da52ed..dba15e865 100644 --- a/js/tests/unit/collapse.js +++ b/js/tests/unit/collapse.js @@ -52,6 +52,29 @@ $(function () { assert.ok(!/height/i.test($el.attr('style')), 'has height reset') }) + QUnit.test('should collapse only the first collapse', function (assert) { + assert.expect(2) + var html = [ + '
', + '
', + '
', + '
', + '
', + '
', + '
', + '
', + '
', + '
' + ].join('') + $(html).appendTo('#qunit-fixture') + var $el1 = $('#collapse1') + var $el2 = $('#collapse2') + $el1.bootstrapCollapse('show') + + assert.ok($el1.hasClass('in')) + assert.ok($el2.hasClass('in')) + }) + QUnit.test('should hide a collapsed element', function (assert) { assert.expect(1) var $el = $('
').bootstrapCollapse('hide') -- cgit v1.2.3