Skip to content

Commit 92451b4

Browse files
committed
Tooltip: Allow tracking tooltips to be off by a fraciton of a pixel
Closes jquerygh-1718
1 parent dc8b1c8 commit 92451b4

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

tests/unit/tooltip/options.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,8 +203,16 @@ QUnit.test( "track + show delay", function( assert ) {
203203
event.pageY = topVal;
204204
element.trigger( event );
205205

206-
assert.equal( $( ".ui-tooltip" ).css( "left" ), leftVal + offsetVal + "px" );
207-
assert.equal( $( ".ui-tooltip" ).css( "top" ), topVal + offsetVal + "px" );
206+
assert.close(
207+
parseFloat( $( ".ui-tooltip" ).css( "left" ) ),
208+
leftVal + offsetVal, 0.5,
209+
"left position"
210+
);
211+
assert.close(
212+
parseFloat( $( ".ui-tooltip" ).css( "top" ) ),
213+
topVal + offsetVal, 0.5,
214+
"top position"
215+
);
208216
} );
209217

210218
QUnit.test( "track and programmatic focus", function( assert ) {

0 commit comments

Comments
 (0)