mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-14 18:42:30 +03:00
fix tests
This commit is contained in:
+14
-14
@@ -20,14 +20,14 @@ $(function () {
|
||||
})
|
||||
|
||||
test("should expose defaults var for settings", function () {
|
||||
ok($.fn.modal.defaults, 'default object exposed')
|
||||
ok($.fn.modal.Constructor.DEFAULTS, 'default object exposed')
|
||||
})
|
||||
|
||||
test("should insert into dom when show method is called", function () {
|
||||
stop()
|
||||
$.support.transition = false
|
||||
$("<div id='modal-test'></div>")
|
||||
.bind("shown", function () {
|
||||
.bind("bs:modal:shown", function () {
|
||||
ok($('#modal-test').length, 'modal insterted into dom')
|
||||
$(this).remove()
|
||||
start()
|
||||
@@ -39,10 +39,10 @@ $(function () {
|
||||
stop()
|
||||
$.support.transition = false
|
||||
$("<div id='modal-test'></div>")
|
||||
.bind("show", function () {
|
||||
.bind("bs:modal:show", function () {
|
||||
ok(true, "show was called")
|
||||
})
|
||||
.bind("shown", function () {
|
||||
.bind("bs:modal:shown", function () {
|
||||
$(this).remove()
|
||||
start()
|
||||
})
|
||||
@@ -53,12 +53,12 @@ $(function () {
|
||||
stop()
|
||||
$.support.transition = false
|
||||
$("<div id='modal-test'></div>")
|
||||
.bind("show", function (e) {
|
||||
.bind("bs:modal:show", function (e) {
|
||||
e.preventDefault()
|
||||
ok(true, "show was called")
|
||||
start()
|
||||
})
|
||||
.bind("shown", function () {
|
||||
.bind("bs:modal:shown", function () {
|
||||
ok(false, "shown was called")
|
||||
})
|
||||
.modal("show")
|
||||
@@ -69,12 +69,12 @@ $(function () {
|
||||
$.support.transition = false
|
||||
|
||||
$("<div id='modal-test'></div>")
|
||||
.bind("shown", function () {
|
||||
.bind("bs:modal:shown", function () {
|
||||
ok($('#modal-test').is(":visible"), 'modal visible')
|
||||
ok($('#modal-test').length, 'modal insterted into dom')
|
||||
$(this).modal("hide")
|
||||
})
|
||||
.bind("hidden", function() {
|
||||
.bind("bs:modal:hidden", function() {
|
||||
ok(!$('#modal-test').is(":visible"), 'modal hidden')
|
||||
$('#modal-test').remove()
|
||||
start()
|
||||
@@ -87,12 +87,12 @@ $(function () {
|
||||
$.support.transition = false
|
||||
var div = $("<div id='modal-test'></div>")
|
||||
div
|
||||
.bind("shown", function () {
|
||||
.bind("bs:modal:shown", function () {
|
||||
ok($('#modal-test').is(":visible"), 'modal visible')
|
||||
ok($('#modal-test').length, 'modal insterted into dom')
|
||||
div.modal("toggle")
|
||||
})
|
||||
.bind("hidden", function() {
|
||||
.bind("bs:modal:hidden", function() {
|
||||
ok(!$('#modal-test').is(":visible"), 'modal hidden')
|
||||
div.remove()
|
||||
start()
|
||||
@@ -105,12 +105,12 @@ $(function () {
|
||||
$.support.transition = false
|
||||
var div = $("<div id='modal-test'><span class='close' data-dismiss='modal'></span></div>")
|
||||
div
|
||||
.bind("shown", function () {
|
||||
.bind("bs:modal:shown", function () {
|
||||
ok($('#modal-test').is(":visible"), 'modal visible')
|
||||
ok($('#modal-test').length, 'modal insterted into dom')
|
||||
div.find('.close').click()
|
||||
})
|
||||
.bind("hidden", function() {
|
||||
.bind("bs:modal:hidden", function() {
|
||||
ok(!$('#modal-test').is(":visible"), 'modal hidden')
|
||||
div.remove()
|
||||
start()
|
||||
@@ -123,11 +123,11 @@ $(function () {
|
||||
$.support.transition = false
|
||||
var div = $("<div>", { id: 'modal-test', "data-backdrop": false })
|
||||
div
|
||||
.bind("shown", function () {
|
||||
.bind("bs:modal:shown", function () {
|
||||
ok($('#modal-test').is(":visible"), 'modal visible')
|
||||
div.modal("hide")
|
||||
})
|
||||
.bind("hidden", function() {
|
||||
.bind("bs:modal:hidden", function() {
|
||||
ok(!$('#modal-test').is(":visible"), 'modal hidden')
|
||||
div.remove()
|
||||
start()
|
||||
|
||||
Reference in New Issue
Block a user