aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2012-11-21 16:33:46 +0100
committerJörn Zaefferer <joern.zaefferer@gmail.com>2012-11-26 10:28:25 +0100
commita09f5c07f591d0ef198f1a36fab9d4b6061ecbc6 (patch)
treef783e68c0e2d23096da35a6c32746a69f7f4ddcc /tests
parentf3525afe0ec8d6599e2c54571b005b4c3d754352 (diff)
downloadjquery-ui-a09f5c07f591d0ef198f1a36fab9d4b6061ecbc6.tar.gz
jquery-ui-a09f5c07f591d0ef198f1a36fab9d4b6061ecbc6.zip
Dialog: Follow-up to 9fe3a62d8 - also deprecate string notation for position option.
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/dialog/dialog_deprecated.js32
-rw-r--r--tests/unit/dialog/dialog_options.js32
2 files changed, 31 insertions, 33 deletions
diff --git a/tests/unit/dialog/dialog_deprecated.js b/tests/unit/dialog/dialog_deprecated.js
index 06052b6bf..fcbd22faa 100644
--- a/tests/unit/dialog/dialog_deprecated.js
+++ b/tests/unit/dialog/dialog_deprecated.js
@@ -1,4 +1,4 @@
-module("dialog (deprecated): position opton with array");
+module("dialog (deprecated): position option with string and array");
if ( !$.ui.ie ) {
test("position, right bottom on window w/array", function() {
@@ -10,6 +10,16 @@ if ( !$.ui.ie ) {
closeEnough(offset.top, $(window).height() - dialog.outerHeight() + $(window).scrollTop(), 1);
el.remove();
});
+
+ test("position, right bottom on window", function() {
+ expect( 2 );
+ var el = $('<div></div>').dialog({ position: "right bottom" }),
+ dialog = el.dialog('widget'),
+ offset = dialog.offset();
+ closeEnough(offset.left, $(window).width() - dialog.outerWidth() + $(window).scrollLeft(), 1);
+ closeEnough(offset.top, $(window).height() - dialog.outerHeight() + $(window).scrollTop(), 1);
+ el.remove();
+ });
}
test("position, offset from top left w/array", function() {
@@ -21,3 +31,23 @@ test("position, offset from top left w/array", function() {
closeEnough(offset.top, 10 + $(window).scrollTop(), 1);
el.remove();
});
+
+test("position, top on window", function() {
+ expect( 2 );
+ var el = $('<div></div>').dialog({ position: "top" }),
+ dialog = el.dialog('widget'),
+ offset = dialog.offset();
+ closeEnough(offset.left, Math.round($(window).width() / 2 - dialog.outerWidth() / 2) + $(window).scrollLeft(), 1);
+ closeEnough(offset.top, $(window).scrollTop(), 1);
+ el.remove();
+});
+
+test("position, left on window", function() {
+ expect( 2 );
+ var el = $('<div></div>').dialog({ position: "left" }),
+ dialog = el.dialog('widget'),
+ offset = dialog.offset();
+ closeEnough(offset.left, 0, 1);
+ closeEnough(offset.top, Math.round($(window).height() / 2 - dialog.outerHeight() / 2) + $(window).scrollTop(), 1);
+ el.remove();
+});
diff --git a/tests/unit/dialog/dialog_options.js b/tests/unit/dialog/dialog_options.js
index 4e11ecf62..f01a1a2a8 100644
--- a/tests/unit/dialog/dialog_options.js
+++ b/tests/unit/dialog/dialog_options.js
@@ -298,39 +298,8 @@ test("position, default center on window", function() {
el.remove();
});
-test("position, top on window", function() {
- expect( 2 );
- var el = $('<div></div>').dialog({ position: "top" }),
- dialog = el.dialog('widget'),
- offset = dialog.offset();
- closeEnough(offset.left, Math.round($(window).width() / 2 - dialog.outerWidth() / 2) + $(window).scrollLeft(), 1);
- closeEnough(offset.top, $(window).scrollTop(), 1);
- el.remove();
-});
-
-test("position, left on window", function() {
- expect( 2 );
- var el = $('<div></div>').dialog({ position: "left" }),
- dialog = el.dialog('widget'),
- offset = dialog.offset();
- closeEnough(offset.left, 0, 1);
- closeEnough(offset.top, Math.round($(window).height() / 2 - dialog.outerHeight() / 2) + $(window).scrollTop(), 1);
- el.remove();
-});
-
// todo: figure out these fails in IE7
if ( !$.ui.ie ) {
-
- test("position, right bottom on window", function() {
- expect( 2 );
- var el = $('<div></div>').dialog({ position: "right bottom" }),
- dialog = el.dialog('widget'),
- offset = dialog.offset();
- closeEnough(offset.left, $(window).width() - dialog.outerWidth() + $(window).scrollLeft(), 1);
- closeEnough(offset.top, $(window).height() - dialog.outerHeight() + $(window).scrollTop(), 1);
- el.remove();
- });
-
test("position, right bottom at right bottom via ui.position args", function() {
expect( 2 );
var el = $('<div></div>').dialog({
@@ -346,7 +315,6 @@ if ( !$.ui.ie ) {
closeEnough(offset.top, $(window).height() - dialog.outerHeight() + $(window).scrollTop(), 1);
el.remove();
});
-
}
test("position, at another element", function() {