Permalink
Browse files

Position Tests: Fix FF and IE10 test failures by accounting for subpi…

…xel offsets.
  • Loading branch information...
1 parent 204a042 commit e12879a441b972fea01697580c05c4ce698578e6 @mikesherov mikesherov committed Mar 31, 2013
Showing with 9 additions and 3 deletions.
  1. +9 −3 tests/unit/position/position_core.js
@@ -221,7 +221,9 @@ test( "of", function() {
});
test( "offsets", function() {
- expect( 7 );
+ expect( 9 );
+
+ var offset;
$( "#elx" ).position({
my: "left top",
@@ -261,15 +263,19 @@ test( "offsets", function() {
of: "#parentx",
collision: "none"
});
- deepEqual( $( "#elx" ).offset(), { top: 65, left: 37 }, "decimal percentage offsets in my" );
+ offset = $( "#elx" ).offset();
+ equal( Math.round( offset.top ), 65, "decimal percentage offsets in my" );
+ equal( Math.round( offset.left ), 37, "decimal percentage offsets in my" );
$( "#elx" ).position({
my: "left+10.4 top-10.6",
at: "left bottom",
of: "#parentx",
collision: "none"
});
- deepEqual( $( "#elx" ).offset(), { top: 49, left: 50 }, "decimal offsets in my" );
+ offset = $( "#elx" ).offset();
+ equal( Math.round( offset.top ), 49, "decimal offsets in my" );
+ equal( Math.round( offset.left ), 50, "decimal offsets in my" );
$( "#elx" ).position({
my: "left+right top-left",

0 comments on commit e12879a

Please sign in to comment.