diff options
| author | Chris Rebert <[email protected]> | 2015-01-20 20:18:33 -0800 |
|---|---|---|
| committer | Chris Rebert <[email protected]> | 2015-01-20 20:18:33 -0800 |
| commit | 1652efc3f6cba0e0b943bdf2a71f681bbd4e154f (patch) | |
| tree | 4e162e03ac33965328fe31fc6f86c39aef6a57dd /js/tests | |
| parent | df73535a2d99539f228afbdd54a387a9ad1a289c (diff) | |
| download | bootstrap-1652efc3f6cba0e0b943bdf2a71f681bbd4e154f.tar.xz bootstrap-1652efc3f6cba0e0b943bdf2a71f681bbd4e154f.zip | |
tweak 'close reopened modal' unit test to work under new QUnit API
Diffstat (limited to 'js/tests')
| -rw-r--r-- | js/tests/unit/modal.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/js/tests/unit/modal.js b/js/tests/unit/modal.js index 3a4a88089..c1af15a2f 100644 --- a/js/tests/unit/modal.js +++ b/js/tests/unit/modal.js @@ -210,13 +210,18 @@ $(function () { var done = assert.async() $('<div id="modal-test"><div class="contents"><div id="close" data-dismiss="modal"/></div></div>') - .on('shown.bs.modal', function () { + .one('shown.bs.modal', function () { $('#close').click() - ok(!$('#modal-test').is(':visible'), 'modal hidden') }) .one('hidden.bs.modal', function () { + // after one open-close cycle + ok(!$('#modal-test').is(':visible'), 'modal hidden') $(this) + .one('shown.bs.modal', function () { + $('#close').click() + }) .one('hidden.bs.modal', function () { + ok(!$('#modal-test').is(':visible'), 'modal hidden') done() }) .bootstrapModal('show') |
