aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMatías Cánepa <matias.canepa@gmail.com>2022-10-10 06:00:50 -0300
committerGitHub <noreply@github.com>2022-10-10 11:00:50 +0200
commit62f2ccc5678a8b09df85afd006eb623ac38af189 (patch)
tree7330a203422d0ddd7a7c3f5f8293ac4cf0ea0de7 /tests
parent5fa0db48d73887facf891eb05b43c443b5baeca3 (diff)
downloadjquery-ui-62f2ccc5678a8b09df85afd006eb623ac38af189.tar.gz
jquery-ui-62f2ccc5678a8b09df85afd006eb623ac38af189.zip
Resizable: Fix resizing of elems with `box-sizing: border-box`
Fixes gh-1979 Closes gh-2012
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/resizable/options.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/unit/resizable/options.js b/tests/unit/resizable/options.js
index d85840562..6149fbfef 100644
--- a/tests/unit/resizable/options.js
+++ b/tests/unit/resizable/options.js
@@ -532,4 +532,30 @@ QUnit.test( "alsoResize + multiple selection", function( assert ) {
assert.equal( other2.height(), 150, "alsoResize o2 constrained height at containment edge" );
} );
+QUnit.test( "alsoResize with box-sizing: border-box", function( assert ) {
+ assert.expect( 4 );
+
+ var other = $( "<div>" )
+ .css( {
+ width: 50,
+ height: 50,
+ padding: 10,
+ border: 5
+ } )
+ .appendTo( "body" ),
+ element = $( "#resizable1" ).resizable( {
+ alsoResize: other
+ } ),
+ handle = ".ui-resizable-se";
+
+ $( "*" ).css( "box-sizing", "border-box" );
+
+ testHelper.drag( handle, 80, 80 );
+
+ assert.equal( element.width(), 180, "resizable width" );
+ assert.equal( parseFloat( other.css( "width" ) ), 130, "alsoResize width" );
+ assert.equal( element.height(), 180, "resizable height" );
+ assert.equal( parseFloat( other.css( "height" ) ), 130, "alsoResize height" );
+} );
+
} );