]> source.dussan.org Git - jquery-ui.git/commitdiff
Tooltip: Allow tracking tooltips to be off by a fraciton of a pixel
authorScott González <scott.gonzalez@gmail.com>
Wed, 6 Jul 2016 20:39:05 +0000 (16:39 -0400)
committerScott González <scott.gonzalez@gmail.com>
Thu, 7 Jul 2016 13:16:52 +0000 (09:16 -0400)
Closes gh-1718

tests/unit/tooltip/options.js

index 6dec36a6cbe1a1c468ba134a16cee8b2516bf5d4..4354d89b3c92c452d94408a298d6e4c4416fa195 100644 (file)
@@ -203,8 +203,16 @@ QUnit.test( "track + show delay", function( assert ) {
        event.pageY = topVal;
        element.trigger( event );
 
-       assert.equal( $( ".ui-tooltip" ).css( "left" ), leftVal + offsetVal + "px" );
-       assert.equal( $( ".ui-tooltip" ).css( "top" ), topVal + offsetVal + "px" );
+       assert.close(
+               parseFloat( $( ".ui-tooltip" ).css( "left" ) ),
+               leftVal + offsetVal, 0.5,
+               "left position"
+       );
+       assert.close(
+               parseFloat( $( ".ui-tooltip" ).css( "top" ) ),
+               topVal + offsetVal, 0.5,
+               "top position"
+       );
 } );
 
 QUnit.test( "track and programmatic focus", function( assert ) {