From 21b537cc2424f8b51044ad93c70993f29780524a Mon Sep 17 00:00:00 2001 From: Johann-S Date: Thu, 9 Mar 2017 11:08:47 +0100 Subject: [PATCH] Add unit test --- js/tests/unit/collapse.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/js/tests/unit/collapse.js b/js/tests/unit/collapse.js index 7139304338..c39adacdb0 100644 --- a/js/tests/unit/collapse.js +++ b/js/tests/unit/collapse.js @@ -490,4 +490,27 @@ $(function () { .bootstrapCollapse('show') }) + QUnit.test('should allow accordion to use children other than card', function (assert) { + assert.expect(2) + var done = assert.async() + var accordionHTML = '
' + + '
' + + '' + + '
' + + '
' + + '
' + + '' + + '
' + + '
' + + '
' + + $(accordionHTML).appendTo('#qunit-fixture') + var $target = $('#linkTrigger') + $('#collapseOne').on('shown.bs.collapse', function () { + assert.ok($(this).hasClass('show')) + assert.ok(!$('#collapseTwo').hasClass('show')) + done() + }) + $target.trigger($.Event('click')) + }) }) -- 2.47.2