diff options
| author | Mark Otto <[email protected]> | 2017-03-19 18:43:13 -0700 |
|---|---|---|
| committer | Mark Otto <[email protected]> | 2017-03-19 18:43:13 -0700 |
| commit | 3730c5dbf5adc97a96622be0a458da49be188a14 (patch) | |
| tree | 21359415233d0898de00413bf3583691cd73e6e1 /js/tests | |
| parent | 6bc93c9593c2056995ee703abdffc475fb469a24 (diff) | |
| parent | 21b537cc2424f8b51044ad93c70993f29780524a (diff) | |
| download | bootstrap-3730c5dbf5adc97a96622be0a458da49be188a14.tar.xz bootstrap-3730c5dbf5adc97a96622be0a458da49be188a14.zip | |
Merge branch 'collapse' of https://github.com/Johann-S/bootstrap into Johann-S-collapse
Diffstat (limited to 'js/tests')
| -rw-r--r-- | js/tests/unit/collapse.js | 23 |
1 files changed, 23 insertions, 0 deletions
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 = '<div id="accordion" data-children=".item">' + + '<div class="item">' + + '<a id="linkTrigger" data-parent="#accordion" data-toggle="collapse" href="#collapseOne" aria-expanded="false" aria-controls="collapseOne"></a>' + + '<div id="collapseOne" class="collapse" role="tabpanel" aria-labelledby="headingThree"></div>' + + '</div>' + + '<div class="item">' + + '<a data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo"></a>' + + '<div id="collapseTwo" class="collapse show" role="tabpanel" aria-labelledby="headingTwo"></div>' + + '</div>' + + '</div>' + + $(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')) + }) }) |
