aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2009-09-19 14:03:53 +0000
committerJörn Zaefferer <joern.zaefferer@gmail.com>2009-09-19 14:03:53 +0000
commit122a6cdd5fbc1b3e1769bb4669dc68e7d8279177 (patch)
tree2aee02df4825533a300ed0c837a6b4cd015a8b0a /tests
parentc59c0421ba482dc9c2a0a47888564ec98659ccda (diff)
downloadjquery-ui-122a6cdd5fbc1b3e1769bb4669dc68e7d8279177.tar.gz
jquery-ui-122a6cdd5fbc1b3e1769bb4669dc68e7d8279177.zip
dialog: fixed _position regression; wrote a test for the default positon, which still needs some tuning
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/dialog/dialog_options.js11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/unit/dialog/dialog_options.js b/tests/unit/dialog/dialog_options.js
index 7254431fd..761f03b27 100644
--- a/tests/unit/dialog/dialog_options.js
+++ b/tests/unit/dialog/dialog_options.js
@@ -240,7 +240,16 @@ test("modal", function() {
ok(false, 'missing test - untested code is broken code');
});
-test("position", function() {
+test("position, default center on window", function() {
+ var el = $('<div></div>').dialog();
+ var offset = el.parent().offset();
+ // use .position() instead to avoid replicating center-logic?
+ same(offset.left, Math.floor($(window).width() / 2 - el.parent().width() / 2));
+ same(offset.top, Math.floor($(window).height() / 2 - el.parent().height() / 2));
+ el.remove();
+});
+
+test("position, others", function() {
ok(false, 'missing test - untested code is broken code');
});