diff options
Diffstat (limited to 'tests/unit/dialog')
-rw-r--r-- | tests/unit/dialog/dialog_core.js | 1 | ||||
-rw-r--r-- | tests/unit/dialog/dialog_methods.js | 11 | ||||
-rw-r--r-- | tests/unit/dialog/dialog_options.js | 9 | ||||
-rw-r--r-- | tests/unit/dialog/dialog_tickets.js | 2 |
4 files changed, 23 insertions, 0 deletions
diff --git a/tests/unit/dialog/dialog_core.js b/tests/unit/dialog/dialog_core.js index 636b957e8..e0a5c8701 100644 --- a/tests/unit/dialog/dialog_core.js +++ b/tests/unit/dialog/dialog_core.js @@ -116,6 +116,7 @@ test("ARIA", function() { }); test("widget method", function() { + expect( 1 ); var dialog = $("<div>").appendTo("#main").dialog(); deepEqual(dialog.parent()[0], dialog.dialog("widget")[0]); }); diff --git a/tests/unit/dialog/dialog_methods.js b/tests/unit/dialog/dialog_methods.js index 1f84cd6b5..ba0c2bd41 100644 --- a/tests/unit/dialog/dialog_methods.js +++ b/tests/unit/dialog/dialog_methods.js @@ -34,6 +34,8 @@ test("init", function() { }); test("destroy", function() { + expect( 4 ); + $("<div></div>").appendTo('body').dialog().dialog("destroy").remove(); ok(true, '.dialog("destroy") called on element'); @@ -49,6 +51,8 @@ test("destroy", function() { }); test("enable", function() { + expect( 3 ); + var expected = $('<div></div>').dialog(), actual = expected.dialog('enable'); equal(actual, expected, 'enable is chainable'); @@ -60,6 +64,8 @@ test("enable", function() { }); test("disable", function() { + expect( 3 ); + var expected = $('<div></div>').dialog(), actual = expected.dialog('disable'); equal(actual, expected, 'disable is chainable'); @@ -71,6 +77,8 @@ test("disable", function() { }); test("close", function() { + expect( 3 ); + var expected = $('<div></div>').dialog(), actual = expected.dialog('close'); equal(actual, expected, 'close is chainable'); @@ -98,6 +106,8 @@ test("isOpen", function() { }); test("moveToTop", function() { + expect( 3 ); + var d1, d2, dlg1, dlg2, expected = $('<div></div>').dialog(), actual = expected.dialog('moveToTop'); @@ -117,6 +127,7 @@ test("moveToTop", function() { }); test("open", function() { + expect( 3 ); var expected = $('<div></div>').dialog(), actual = expected.dialog('open'); equal(actual, expected, 'open is chainable'); diff --git a/tests/unit/dialog/dialog_options.js b/tests/unit/dialog/dialog_options.js index c071c1b09..ba217c6f4 100644 --- a/tests/unit/dialog/dialog_options.js +++ b/tests/unit/dialog/dialog_options.js @@ -106,6 +106,7 @@ test("buttons - advanced", function() { }); test("closeOnEscape", function() { + expect( 6 ); el = $('<div></div>').dialog({ closeOnEscape: false }); ok(true, 'closeOnEscape: false'); ok(dlg().is(':visible') && !dlg().is(':hidden'), 'dialog is open before ESC'); @@ -276,6 +277,7 @@ test("minWidth", function() { }); test("position, default center on window", function() { + expect( 2 ); var el = $('<div></div>').dialog(), dialog = el.dialog('widget'), offset = dialog.offset(); @@ -285,6 +287,7 @@ test("position, default center on window", function() { }); test("position, top on window", function() { + expect( 2 ); var el = $('<div></div>').dialog({ position: "top" }), dialog = el.dialog('widget'), offset = dialog.offset(); @@ -294,6 +297,7 @@ test("position, top on window", function() { }); test("position, left on window", function() { + expect( 2 ); var el = $('<div></div>').dialog({ position: "left" }), dialog = el.dialog('widget'), offset = dialog.offset(); @@ -303,6 +307,7 @@ test("position, left on window", function() { }); test("position, right bottom on window", function() { + expect( 2 ); var el = $('<div></div>').dialog({ position: "right bottom" }), dialog = el.dialog('widget'), offset = dialog.offset(); @@ -312,6 +317,7 @@ test("position, right bottom on window", function() { }); test("position, right bottom on window w/array", function() { + expect( 2 ); var el = $('<div></div>').dialog({ position: ["right", "bottom"] }), dialog = el.dialog('widget'), offset = dialog.offset(); @@ -321,6 +327,7 @@ test("position, right bottom on window w/array", function() { }); test("position, offset from top left w/array", function() { + expect( 2 ); var el = $('<div></div>').dialog({ position: [10, 10] }), dialog = el.dialog('widget'), offset = dialog.offset(); @@ -330,6 +337,7 @@ test("position, offset from top left w/array", function() { }); test("position, right bottom at right bottom via ui.position args", function() { + expect( 2 ); var el = $('<div></div>').dialog({ position: { my: "right bottom", @@ -345,6 +353,7 @@ test("position, right bottom at right bottom via ui.position args", function() { }); test("position, at another element", function() { + expect( 4 ); var parent = $('<div></div>').css({ position: 'absolute', top: 400, diff --git a/tests/unit/dialog/dialog_tickets.js b/tests/unit/dialog/dialog_tickets.js index 98983cf33..201ea3a87 100644 --- a/tests/unit/dialog/dialog_tickets.js +++ b/tests/unit/dialog/dialog_tickets.js @@ -71,6 +71,7 @@ test("#5184: isOpen in dialogclose event is true", function() { }); test("#5531: dialog width should be at least minWidth on creation", function () { + expect( 4 ); el = $('<div></div>').dialog({ width: 200, minWidth: 300 @@ -192,6 +193,7 @@ test("#6966: Escape key closes all dialogs, not the top one", function(){ }); test("#4980: Destroy should place element back in original DOM position", function(){ + expect( 2 ); container = $('<div id="container"><div id="modal">Content</div></div>'); modal = container.find('#modal'); modal.dialog(); |