From 21b537cc2424f8b51044ad93c70993f29780524a Mon Sep 17 00:00:00 2001 From: Johann-S Date: Thu, 9 Mar 2017 11:08:47 +0100 Subject: Add unit test --- js/tests/unit/collapse.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'js/tests/unit') diff --git a/js/tests/unit/collapse.js b/js/tests/unit/collapse.js index 713930433..c39adacdb 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')) + }) }) -- cgit v1.2.3 From 1a46d8c7309092566c2da8cbaa9999ae0a1bacc7 Mon Sep 17 00:00:00 2001 From: Johann Date: Sun, 19 Mar 2017 00:36:33 +0100 Subject: Allow to use Tab.js with list-group (#21756) * Allow to use Tab.js with list-group * Allow to use list-group with div parent instead of an ul parent --- js/tests/unit/tab.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'js/tests/unit') diff --git a/js/tests/unit/tab.js b/js/tests/unit/tab.js index 734648e9e..d0aeb372b 100644 --- a/js/tests/unit/tab.js +++ b/js/tests/unit/tab.js @@ -108,6 +108,22 @@ $(function () { assert.strictEqual($('#qunit-fixture').find('.active').attr('id'), 'home') }) + QUnit.test('should activate element by tab id in list-group', function (assert) { + assert.expect(2) + var ulHTML = '' + + $('