Skip to content

Commit 613b522

Browse files
committed
Tests: Make resizable tests a bit more forgiving
1 parent b715135 commit 613b522

File tree

1 file changed

+16
-6
lines changed

1 file changed

+16
-6
lines changed

tests/unit/resizable/options.js

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -524,12 +524,22 @@ QUnit.test( "alsoResize + multiple selection", function( assert ) {
524524
} );
525525

526526
testHelper.drag( ".ui-resizable-se", 400, 400 );
527-
assert.equal( element.width(), 300, "resizable constrained width at containment edge" );
528-
assert.equal( element.height(), 200, "resizable constrained height at containment edge" );
529-
assert.equal( other1.width(), 250, "alsoResize o1 constrained width at containment edge" );
530-
assert.equal( other1.height(), 150, "alsoResize o1 constrained height at containment edge" );
531-
assert.equal( other2.width(), 250, "alsoResize o2 constrained width at containment edge" );
532-
assert.equal( other2.height(), 150, "alsoResize o2 constrained height at containment edge" );
527+
528+
// Support: IE <=11+, jQuery 3.0 - 3.1 only
529+
// IE sizing under jQuery 3.0 & 3.1 has a small delta compared to expected values.
530+
// This delta is small so accept it.
531+
assert.close( element.width(), 300, 0.01,
532+
"resizable constrained width at containment edge" );
533+
assert.close( element.height(), 200, 0.01,
534+
"resizable constrained height at containment edge" );
535+
assert.close( other1.width(), 250, 0.01,
536+
"alsoResize o1 constrained width at containment edge" );
537+
assert.close( other1.height(), 150, 0.01,
538+
"alsoResize o1 constrained height at containment edge" );
539+
assert.close( other2.width(), 250, 0.01,
540+
"alsoResize o2 constrained width at containment edge" );
541+
assert.close( other2.height(), 150, 0.01,
542+
"alsoResize o2 constrained height at containment edge" );
533543
} );
534544

535545
QUnit.test( "alsoResize with box-sizing: border-box", function( assert ) {

0 commit comments

Comments
 (0)