Skip to content

Commit d9391c7

Browse files
mikesherovscottgonzalez
authored andcommitted
Position Tests: Fix FF and IE10 test failures by accounting for subpixel offsets.(cherry picked from commit e12879a)
1 parent 3f29430 commit d9391c7

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tests/unit/position/position_core.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,9 @@ test( "of", function() {
221221
});
222222

223223
test( "offsets", function() {
224-
expect( 7 );
224+
expect( 9 );
225+
226+
var offset;
225227

226228
$( "#elx" ).position({
227229
my: "left top",
@@ -261,15 +263,19 @@ test( "offsets", function() {
261263
of: "#parentx",
262264
collision: "none"
263265
});
264-
deepEqual( $( "#elx" ).offset(), { top: 65, left: 37 }, "decimal percentage offsets in my" );
266+
offset = $( "#elx" ).offset();
267+
equal( Math.round( offset.top ), 65, "decimal percentage offsets in my" );
268+
equal( Math.round( offset.left ), 37, "decimal percentage offsets in my" );
265269

266270
$( "#elx" ).position({
267271
my: "left+10.4 top-10.6",
268272
at: "left bottom",
269273
of: "#parentx",
270274
collision: "none"
271275
});
272-
deepEqual( $( "#elx" ).offset(), { top: 49, left: 50 }, "decimal offsets in my" );
276+
offset = $( "#elx" ).offset();
277+
equal( Math.round( offset.top ), 49, "decimal offsets in my" );
278+
equal( Math.round( offset.left ), 50, "decimal offsets in my" );
273279

274280
$( "#elx" ).position({
275281
my: "left+right top-left",

0 commit comments

Comments
 (0)