diff options
Diffstat (limited to 'js/tests/unit')
| -rw-r--r-- | js/tests/unit/collapse.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/js/tests/unit/collapse.js b/js/tests/unit/collapse.js index 4470a18c2..9ecb60994 100644 --- a/js/tests/unit/collapse.js +++ b/js/tests/unit/collapse.js @@ -673,4 +673,29 @@ $(function () { }) $trigger3.trigger('click') }) + + QUnit.test('should not prevent interactions inside the collapse element', function (assert) { + assert.expect(2) + var done = assert.async() + + var $target = $('<input type="checkbox" data-toggle="collapse" data-target="#collapsediv1" />').appendTo('#qunit-fixture') + var htmlCollapse = + '<div id="collapsediv1" class="collapse">' + + ' <input type="checkbox" id="testCheckbox" />' + + '</div>' + + $(htmlCollapse) + .appendTo('#qunit-fixture') + .on('shown.bs.collapse', function () { + assert.ok($target.prop('checked'), '$trigger is checked') + var $testCheckbox = $('#testCheckbox') + $testCheckbox.trigger($.Event('click')) + setTimeout(function () { + assert.ok($testCheckbox.prop('checked'), '$testCheckbox is checked too') + done() + }, 5) + }) + + $target.trigger($.Event('click')) + }) }) |
