From de5a98e7bcb841d3b5304dd085ad300f4848a220 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Scott=20Gonz=C3=A1lez?= Date: Tue, 22 Mar 2011 13:25:28 -0400 Subject: [PATCH] Position: Split out tests for deprecated offset option. --- tests/unit/position/positio.html | 60 ++++++++++++++++++++++ tests/unit/position/position.html | 23 +++++---- tests/unit/position/position_core.js | 31 ----------- tests/unit/position/position_deprecated.js | 32 ++++++++++++ 4 files changed, 105 insertions(+), 41 deletions(-) create mode 100644 tests/unit/position/positio.html create mode 100644 tests/unit/position/position_deprecated.js diff --git a/tests/unit/position/positio.html b/tests/unit/position/positio.html new file mode 100644 index 000000000..156235d7b --- /dev/null +++ b/tests/unit/position/positio.html @@ -0,0 +1,60 @@ + + + + + jQuery UI Position Test Suite + + + + + + + + + + + + + + + + +

jQuery UI Position Test Suite

+

+
+

+
    +
+ + + +
+
+
+
+
+ +
+
+
+
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+ + + diff --git a/tests/unit/position/position.html b/tests/unit/position/position.html index 40146d0d7..4f2e87e08 100644 --- a/tests/unit/position/position.html +++ b/tests/unit/position/position.html @@ -1,20 +1,23 @@ - + jQuery UI Position Test Suite - - + + + - - - - + + + + - - - + + + diff --git a/tests/unit/position/position_core.js b/tests/unit/position/position_core.js index c6301d713..5a47fe6bb 100644 --- a/tests/unit/position/position_core.js +++ b/tests/unit/position/position_core.js @@ -239,37 +239,6 @@ test( "offsets", function() { same( $( "#elx" ).offset(), { top: 65, left: 37 }, "percentage offsets in my" ); }); -if ( $.uiBackCompat !== false ) { - test( "offset", function() { - $( "#elx" ).position({ - my: "left top", - at: "left bottom", - of: "#parentx", - offset: "10", - collision: "none" - }); - same( $( "#elx" ).offset(), { top: 70, left: 50 }, "single value" ); - - $( "#elx" ).position({ - my: "left top", - at: "left bottom", - of: "#parentx", - offset: "5 -3", - collision: "none" - }); - same( $( "#elx" ).offset(), { top: 57, left: 45 }, "two values" ); - - $( "#elx" ).position({ - my: "left top", - at: "left bottom", - of: "#parentx", - offset: "5px -3px", - collision: "none" - }); - same( $( "#elx" ).offset(), { top: 57, left: 45 }, "with units" ); - }); -} - test( "using", function() { expect( 6 ); diff --git a/tests/unit/position/position_deprecated.js b/tests/unit/position/position_deprecated.js new file mode 100644 index 000000000..3e72c4a4d --- /dev/null +++ b/tests/unit/position/position_deprecated.js @@ -0,0 +1,32 @@ +(function( $ ) { + +test( "offset", function() { + $( "#elx" ).position({ + my: "left top", + at: "left bottom", + of: "#parentx", + offset: "10", + collision: "none" + }); + same( $( "#elx" ).offset(), { top: 70, left: 50 }, "single value" ); + + $( "#elx" ).position({ + my: "left top", + at: "left bottom", + of: "#parentx", + offset: "5 -3", + collision: "none" + }); + same( $( "#elx" ).offset(), { top: 57, left: 45 }, "two values" ); + + $( "#elx" ).position({ + my: "left top", + at: "left bottom", + of: "#parentx", + offset: "5px -3px", + collision: "none" + }); + same( $( "#elx" ).offset(), { top: 57, left: 45 }, "with units" ); +}); + +}( jQuery ) ); -- 2.39.5