@@ -33,11 +33,8 @@ return $.extend( helper, {
33
33
assert . ok ( expectedDX - actualDX <= 1 && expectedDY - actualDY <= 1 , "dragged[" + expectedDX + ", " + expectedDY + "] " + msg ) ;
34
34
} ,
35
35
36
- // TODO switch back to checking the size of the .ui-dialog element (var d)
37
- // once we switch to using box-sizing: border-box (#9845) that should work fine
38
- // using the element's dimensions to avoid subpixel errors
39
36
shouldResize : function ( assert , element , dw , dh , msg ) {
40
- var heightAfter , widthAfter , actual , expected ,
37
+ var actualDH , actualDW , heightAfter , widthAfter
41
38
d = element . dialog ( "widget" ) ,
42
39
handle = $ ( ".ui-resizable-se" , d ) ,
43
40
heightBefore = element . height ( ) ,
@@ -49,9 +46,13 @@ return $.extend( helper, {
49
46
widthAfter = element . width ( ) ;
50
47
51
48
msg = msg ? msg + "." : "" ;
52
- actual = { width : widthAfter , height : heightAfter } ,
53
- expected = { width : widthBefore + dw , height : heightBefore + dh } ;
54
- assert . deepEqual ( actual , expected , "resized[" + 50 + ", " + 50 + "] " + msg ) ;
49
+
50
+ actualDH = heightAfter - heightBefore ;
51
+ actualDW = widthAfter - widthBefore ;
52
+
53
+ // TODO: Switch to assert.close().
54
+ // Also change the testDrag() helper.
55
+ assert . ok ( Math . abs ( actualDH - dh ) <= 1 && Math . abs ( actualDW - dw ) <= 1 , "resized[50, 50] " + msg ) ;
55
56
}
56
57
} ) ;
57
58
0 commit comments