Skip to content

Commit 80b2c3a

Browse files
committed
Updated tests.
1 parent 4ad61c9 commit 80b2c3a

File tree

2 files changed

+14
-26
lines changed

2 files changed

+14
-26
lines changed

tests/unit/resizable/core.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ QUnit.test( "nested resizable", function( assert ) {
247247
QUnit.test( "Resizable with scrollbars and box-sizing: border-box", function( assert ) {
248248
assert.expect( 4 );
249249

250-
var style = $( "<style> * { box-sizing: border-box; } </style>" ).appendTo( "head" );
250+
$( "<style> * { box-sizing: border-box; } </style>" ).appendTo( "#qunit-fixture" );
251251

252252
//Both scrollbars
253253
var elementContent = $( "<div>" )
@@ -272,14 +272,12 @@ QUnit.test( "Resizable with scrollbars and box-sizing: border-box", function( as
272272
testHelper.drag( handle, 10, 10 );
273273
assert.equal( element.width(), 120, "element width (only vertical scrollbar)" );
274274
assert.equal( element.height(), 120, "element height (only vertical scrollbar)" );
275-
276-
style.remove();
277275
} );
278276

279277
QUnit.test( "Resizable with scrollbars and box-sizing: content-box", function( assert ) {
280278
assert.expect( 4 );
281279

282-
var style = $( "<style> * { box-sizing: content-box; } </style>" ).appendTo( "head" );
280+
$( "<style> * { box-sizing: content-box; } </style>" ).appendTo( "#qunit-fixture" );
283281

284282
//Both scrollbars
285283
var elementContent = $( "<div>" )
@@ -309,14 +307,12 @@ QUnit.test( "Resizable with scrollbars and box-sizing: content-box", function( a
309307
testHelper.drag( handle, 10, 10 );
310308
assert.equal( parseFloat( element.innerWidth() ), widthBefore + 20, "element width (only vertical scrollbar)" );
311309
assert.equal( parseFloat( element.innerHeight() ), heightBefore + 20, "element height (only vertical scrollbar)" );
312-
313-
style.remove();
314310
} );
315311

316312
QUnit.test( "Resizable with scrollbars, a transform and box-sizing: border-box", function( assert ) {
317313
assert.expect( 4 );
318314

319-
var style = $( "<style> * { box-sizing: border-box; } </style>" ).appendTo( "head" );
315+
$( "<style> * { box-sizing: border-box; } </style>" ).appendTo( "#qunit-fixture" );
320316

321317
//Both scrollbars
322318
var elementContent = $( "<div>" )
@@ -341,14 +337,12 @@ QUnit.test( "Resizable with scrollbars, a transform and box-sizing: border-box",
341337
testHelper.drag( handle, 10, 10 );
342338
assert.equal( element.width(), 120, "element width (only vertical scrollbar)" );
343339
assert.equal( element.height(), 120, "element height (only vertical scrollbar)" );
344-
345-
style.remove();
346340
} );
347341

348342
QUnit.test( "Resizable with scrollbars, a transform and box-sizing: content-box", function( assert ) {
349343
assert.expect( 4 );
350344

351-
var style = $( "<style> * { box-sizing: content-box; } </style>" ).appendTo( "head" );
345+
$( "<style> * { box-sizing: content-box; } </style>" ).appendTo( "#qunit-fixture" );
352346

353347
//Both scrollbars
354348
var elementContent = $( "<div>" )
@@ -378,8 +372,6 @@ QUnit.test( "Resizable with scrollbars, a transform and box-sizing: content-box"
378372
testHelper.drag( handle, 10, 10 );
379373
assert.equal( parseFloat( element.innerWidth() ), widthBefore + 20, "element width (only vertical scrollbar)" );
380374
assert.equal( parseFloat( element.innerHeight() ), heightBefore + 20, "element height (only vertical scrollbar)" );
381-
382-
style.remove();
383375
} );
384376

385377
} );

tests/unit/resizable/options.js

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -542,21 +542,22 @@ QUnit.test( "alsoResize + multiple selection", function( assert ) {
542542
QUnit.test( "alsoResize with box-sizing: border-box", function( assert ) {
543543
assert.expect( 4 );
544544

545+
$( "<style> * { box-sizing: border-box; } </style>" ).appendTo( "#qunit-fixture" );
546+
545547
var other = $( "<div>" )
546548
.css( {
547-
width: 50,
548-
height: 50,
549-
padding: 10,
550-
border: 5
549+
width: "50px",
550+
height: "50px",
551+
padding: "10px",
552+
border: "5px",
553+
borderStyle: "solid"
551554
} )
552-
.appendTo( "body" ),
555+
.appendTo( "#qunit-fixture" ),
553556
element = $( "#resizable1" ).resizable( {
554557
alsoResize: other
555558
} ),
556559
handle = ".ui-resizable-se";
557560

558-
$( "*" ).css( "box-sizing", "border-box" );
559-
560561
testHelper.drag( handle, 80, 80 );
561562

562563
assert.equal( element.width(), 180, "resizable width" );
@@ -568,7 +569,7 @@ QUnit.test( "alsoResize with box-sizing: border-box", function( assert ) {
568569
QUnit.test( "alsoResize with scrollbars and box-sizing: border-box", function( assert ) {
569570
assert.expect( 4 );
570571

571-
var style = $( "<style> * { box-sizing: border-box; } </style>" ).appendTo( "head" );
572+
$( "<style> * { box-sizing: border-box; } </style>" ).appendTo( "#qunit-fixture" );
572573

573574
var other = $( "<div>" )
574575
.css( {
@@ -592,14 +593,12 @@ QUnit.test( "alsoResize with scrollbars and box-sizing: border-box", function( a
592593
assert.equal( parseFloat( other.css( "width" ) ), 230, "alsoResize width" );
593594
assert.equal( element.height(), 180, "resizable height" );
594595
assert.equal( parseFloat( other.css( "height" ) ), 230, "alsoResize height" );
595-
596-
style.remove();
597596
} );
598597

599598
QUnit.test( "alsoResize with scrollbars and box-sizing: content-box", function( assert ) {
600599
assert.expect( 4 );
601600

602-
var style = $( "<style> * { box-sizing: content-box; } </style>" ).appendTo( "head" );
601+
$( "<style> * { box-sizing: content-box; } </style>" ).appendTo( "#qunit-fixture" );
603602

604603
var other = $( "<div>" )
605604
.css( {
@@ -627,9 +626,6 @@ QUnit.test( "alsoResize with scrollbars and box-sizing: content-box", function(
627626
assert.equal( parseFloat( other.innerWidth() ), widthBefore + 80, "alsoResize width" );
628627
assert.equal( element.height(), 180, "resizable height" );
629628
assert.equal( parseFloat( other.innerHeight() ), heightBefore + 80, "alsoResize height" );
630-
631-
style.remove();
632629
} );
633630

634-
635631
} );

0 commit comments

Comments
 (0)