You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test("position, default center on window",function(){
341
+
test("position, default center on window",function(assert){
342
342
expect(2);
343
343
344
344
// dialogs alter the window width and height in Firefox
@@ -349,12 +349,12 @@ test( "position, default center on window", function() {
349
349
element=$("<div></div>").dialog(),
350
350
dialog=element.dialog("widget"),
351
351
offset=dialog.offset();
352
-
closeEnough(offset.left,Math.round(winWidth/2-dialog.outerWidth()/2)+$(window).scrollLeft(),1,"dialog left position of center on window on initilization");
353
-
closeEnough(offset.top,Math.round(winHeight/2-dialog.outerHeight()/2)+$(window).scrollTop(),1,"dialog top position of center on window on initilization");
352
+
assert.close(offset.left,Math.round(winWidth/2-dialog.outerWidth()/2)+$(window).scrollLeft(),1,"dialog left position of center on window on initilization");
353
+
assert.close(offset.top,Math.round(winHeight/2-dialog.outerHeight()/2)+$(window).scrollTop(),1,"dialog top position of center on window on initilization");
354
354
element.remove();
355
355
});
356
356
357
-
test("position, right bottom at right bottom via ui.position args",function(){
357
+
test("position, right bottom at right bottom via ui.position args",function(assert){
358
358
expect(2);
359
359
360
360
// dialogs alter the window width and height in Firefox
@@ -371,12 +371,12 @@ test( "position, right bottom at right bottom via ui.position args", function()
371
371
dialog=element.dialog("widget"),
372
372
offset=dialog.offset();
373
373
374
-
closeEnough(offset.left,winWidth-dialog.outerWidth()+$(window).scrollLeft(),1,"dialog left position of right bottom at right bottom on initilization");
375
-
closeEnough(offset.top,winHeight-dialog.outerHeight()+$(window).scrollTop(),1,"dialog top position of right bottom at right bottom on initilization");
374
+
assert.close(offset.left,winWidth-dialog.outerWidth()+$(window).scrollLeft(),1,"dialog left position of right bottom at right bottom on initilization");
375
+
assert.close(offset.top,winHeight-dialog.outerHeight()+$(window).scrollTop(),1,"dialog top position of right bottom at right bottom on initilization");
376
376
element.remove();
377
377
});
378
378
379
-
test("position, at another element",function(){
379
+
test("position, at another element",function(assert){
380
380
expect(4);
381
381
varparent=$("<div></div>").css({
382
382
position: "absolute",
@@ -398,8 +398,8 @@ test( "position, at another element", function() {
398
398
dialog=element.dialog("widget"),
399
399
offset=dialog.offset();
400
400
401
-
closeEnough(offset.left,600,1,"dialog left position at another element on initilization");
402
-
closeEnough(offset.top,400,1,"dialog top position at another element on initilization");
401
+
assert.close(offset.left,600,1,"dialog left position at another element on initilization");
402
+
assert.close(offset.top,400,1,"dialog top position at another element on initilization");
403
403
404
404
element.dialog("option","position",{
405
405
my: "left top",
@@ -410,8 +410,8 @@ test( "position, at another element", function() {
410
410
411
411
offset=dialog.offset();
412
412
413
-
closeEnough(offset.left,610,1,"dialog left position at another element via setting option");
414
-
closeEnough(offset.top,410,1,"dialog top position at another element via setting option");
413
+
assert.close(offset.left,610,1,"dialog left position at another element via setting option");
414
+
assert.close(offset.top,410,1,"dialog top position at another element via setting option");
0 commit comments