diff options
author | Jacob Thornton <jacobthornton@gmail.com> | 2011-09-11 09:14:57 +0400 |
---|---|---|
committer | Jacob Thornton <jacobthornton@gmail.com> | 2011-09-11 09:14:57 +0400 |
commit | 64176caa972fdf925fe244cdbf1d53d82da592f4 (patch) | |
tree | 413ff6c850a038be203b64526caca958db1487c6 /js/tests/unit/bootstrap-modal.js | |
parent | a71d5d8e991eee4073d3312743778b1991cfb650 (diff) |
add bootstrap-scrollspy
Diffstat (limited to 'js/tests/unit/bootstrap-modal.js')
-rw-r--r-- | js/tests/unit/bootstrap-modal.js | 68 |
1 files changed, 49 insertions, 19 deletions
diff --git a/js/tests/unit/bootstrap-modal.js b/js/tests/unit/bootstrap-modal.js index cfdf4064d3..513d287804 100644 --- a/js/tests/unit/bootstrap-modal.js +++ b/js/tests/unit/bootstrap-modal.js @@ -17,40 +17,70 @@ $(function () { }) test("should insert into dom when modal:show event is called", function () { + stop() $.support.transition = false var div = $("<div id='modal-test'></div>") - div.modal().trigger("modal:show") - ok($('#modal-test').length, 'modal insterted into dom') - div.remove() + div + .modal() + .trigger("modal:show") + .bind("modal:shown", function () { + ok($('#modal-test').length, 'modal insterted into dom') + start() + div.remove() + }) }) - test("should remove from dom when close is called", function () { + test("should remove from dom when modal:hide is called", function () { + stop() $.support.transition = false var div = $("<div id='modal-test'></div>") - div.modal().trigger("modal:show") - ok($('#modal-test').length, 'modal insterted into dom') - div.trigger("modal:hide") - ok(!$('#modal-test').length, 'modal removed from dom') - div.remove() + div + .modal() + .trigger("modal:show") + .bind("modal:shown", function () { + ok($('#modal-test').length, 'modal insterted into dom') + div.trigger("modal:hide") + }) + .bind("modal:hidden", function() { + ok(!$('#modal-test').length, 'modal removed from dom') + start() + div.remove() + }) }) test("should toggle when toggle is called", function () { + stop() $.support.transition = false var div = $("<div id='modal-test'></div>") - div.modal().trigger("modal:toggle") - ok($('#modal-test').length, 'modal insterted into dom') - div.trigger("modal:toggle") - ok(!$('#modal-test').length, 'modal removed from dom') - div.remove() + div + .modal() + .trigger("modal:toggle") + .bind("modal:shown", function () { + ok($('#modal-test').length, 'modal insterted into dom') + div.trigger("modal:toggle") + }) + .bind("modal:hidden", function() { + ok(!$('#modal-test').length, 'modal removed from dom') + start() + div.remove() + }) }) test("should remove from dom when click .close", function () { + stop() $.support.transition = false var div = $("<div id='modal-test'><span class='close'></span></div>") - div.modal().trigger("modal:toggle") - ok($('#modal-test').length, 'modal insterted into dom') - div.find('.close').click() - ok(!$('#modal-test').length, 'modal removed from dom') - div.remove() + div + .modal() + .trigger("modal:toggle") + .bind("modal:shown", function () { + ok($('#modal-test').length, 'modal insterted into dom') + div.find('.close').click() + }) + .bind("modal:hidden", function() { + ok(!$('#modal-test').length, 'modal removed from dom') + start() + div.remove() + }) }) })
\ No newline at end of file |