Skip to content

Commit 23655f0

Browse files
authored
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
1 parent 7adb13a commit 23655f0

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/unit/selectmenu/options.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ QUnit.test( "width", function( assert ) {
101101
assert.equal( button[ 0 ].style.width, "", "no inline style" );
102102

103103
element.selectmenu( "option", "width", null );
104-
assert.equal( button.outerWidth(), element.outerWidth(), "button width auto" );
104+
assert.close( button.outerWidth(), element.outerWidth(), 0.01, "button width auto" );
105105

106106
element.outerWidth( 100 );
107107
element.selectmenu( "refresh" );
@@ -117,7 +117,8 @@ QUnit.test( "width", function( assert ) {
117117
.append( $( "<option>", { text: "Option with a little longer text" } ) )
118118
.selectmenu( "option", "width", null )
119119
.selectmenu( "refresh" );
120-
assert.equal( button.outerWidth(), element.outerWidth(), "button width with long option" );
120+
assert.close( button.outerWidth(), element.outerWidth(), 0.01,
121+
"button width with long option" );
121122

122123
element.parent().outerWidth( 300 );
123124
element

0 commit comments

Comments
 (0)