From 122a6cdd5fbc1b3e1769bb4669dc68e7d8279177 Mon Sep 17 00:00:00 2001 From: Jörn Zaefferer Date: Sat, 19 Sep 2009 14:03:53 +0000 Subject: dialog: fixed _position regression; wrote a test for the default positon, which still needs some tuning --- tests/unit/dialog/dialog_options.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tests') 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 = $('
').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'); }); -- cgit v1.2.3