mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Tests: Fix selectmenu width tests in Firefox with jQuery 3.0 & 3.1
jQuery 3.0 & 3.1 used `getBoundingClientRect()` in its `width`/`height` calculations and that causes minor differences in fractional width computations. Allow a tiny delta in tests to fix those tests breaking in Firefox. Ref jquery/jquery#3561 Closes gh-2159
This commit is contained in:
parent
7adb13ac7c
commit
23655f0dbd
@ -101,7 +101,7 @@ QUnit.test( "width", function( assert ) {
|
||||
assert.equal( button[ 0 ].style.width, "", "no inline style" );
|
||||
|
||||
element.selectmenu( "option", "width", null );
|
||||
assert.equal( button.outerWidth(), element.outerWidth(), "button width auto" );
|
||||
assert.close( button.outerWidth(), element.outerWidth(), 0.01, "button width auto" );
|
||||
|
||||
element.outerWidth( 100 );
|
||||
element.selectmenu( "refresh" );
|
||||
@ -117,7 +117,8 @@ QUnit.test( "width", function( assert ) {
|
||||
.append( $( "<option>", { text: "Option with a little longer text" } ) )
|
||||
.selectmenu( "option", "width", null )
|
||||
.selectmenu( "refresh" );
|
||||
assert.equal( button.outerWidth(), element.outerWidth(), "button width with long option" );
|
||||
assert.close( button.outerWidth(), element.outerWidth(), 0.01,
|
||||
"button width with long option" );
|
||||
|
||||
element.parent().outerWidth( 300 );
|
||||
element
|
||||
|
Loading…
Reference in New Issue
Block a user