diff options
author | Jacob Thornton <jacobthornton@gmail.com> | 2011-09-12 09:58:51 +0400 |
---|---|---|
committer | Jacob Thornton <jacobthornton@gmail.com> | 2011-09-12 09:58:51 +0400 |
commit | dcf9aabc44d4ca7cd544b726d4eee15ef1cd35a5 (patch) | |
tree | d7734821e0c12b5dfec14f21b3fe8e126f7fce2f /js/tests/unit/bootstrap-modal.js | |
parent | 0afba3867d8d52178faa43434b94e2e9a1b1c5bd (diff) |
get all spec passing again
Diffstat (limited to 'js/tests/unit/bootstrap-modal.js')
-rw-r--r-- | js/tests/unit/bootstrap-modal.js | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/js/tests/unit/bootstrap-modal.js b/js/tests/unit/bootstrap-modal.js index 513d287804..4bbb3313cc 100644 --- a/js/tests/unit/bootstrap-modal.js +++ b/js/tests/unit/bootstrap-modal.js @@ -16,36 +16,37 @@ $(function () { ok($.fn.modal.defaults, 'default object exposed') }) - test("should insert into dom when modal:show event is called", function () { + test("should insert into dom when show method is called", function () { stop() $.support.transition = false var div = $("<div id='modal-test'></div>") div .modal() - .trigger("modal:show") - .bind("modal:shown", function () { + .modal("show") + .bind("shown", function () { ok($('#modal-test').length, 'modal insterted into dom') start() div.remove() }) }) - test("should remove from dom when modal:hide is called", function () { + test("should hide modal when hide is called", function () { stop() $.support.transition = false var div = $("<div id='modal-test'></div>") div .modal() - .trigger("modal:show") - .bind("modal:shown", function () { + .bind("shown", function () { + ok($('#modal-test').is(":visible"), 'modal visible') ok($('#modal-test').length, 'modal insterted into dom') - div.trigger("modal:hide") + div.modal("hide") }) - .bind("modal:hidden", function() { - ok(!$('#modal-test').length, 'modal removed from dom') + .bind("hidden", function() { + ok(!$('#modal-test').is(":visible"), 'modal hidden') start() div.remove() }) + .modal("show") }) test("should toggle when toggle is called", function () { @@ -54,16 +55,17 @@ $(function () { var div = $("<div id='modal-test'></div>") div .modal() - .trigger("modal:toggle") - .bind("modal:shown", function () { + .bind("shown", function () { + ok($('#modal-test').is(":visible"), 'modal visible') ok($('#modal-test').length, 'modal insterted into dom') - div.trigger("modal:toggle") + div.modal("toggle") }) - .bind("modal:hidden", function() { - ok(!$('#modal-test').length, 'modal removed from dom') + .bind("hidden", function() { + ok(!$('#modal-test').is(":visible"), 'modal hidden') start() div.remove() }) + .modal("toggle") }) test("should remove from dom when click .close", function () { @@ -72,15 +74,16 @@ $(function () { var div = $("<div id='modal-test'><span class='close'></span></div>") div .modal() - .trigger("modal:toggle") - .bind("modal:shown", function () { + .bind("shown", function () { + ok($('#modal-test').is(":visible"), 'modal visible') ok($('#modal-test').length, 'modal insterted into dom') div.find('.close').click() }) - .bind("modal:hidden", function() { - ok(!$('#modal-test').length, 'modal removed from dom') + .bind("hidden", function() { + ok(!$('#modal-test').is(":visible"), 'modal hidden') start() div.remove() }) + .modal("toggle") }) })
\ No newline at end of file |