aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/position/position_core.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/position/position_core.js')
-rw-r--r--tests/unit/position/position_core.js26
1 files changed, 25 insertions, 1 deletions
diff --git a/tests/unit/position/position_core.js b/tests/unit/position/position_core.js
index 7b51223ac..cefd7929c 100644
--- a/tests/unit/position/position_core.js
+++ b/tests/unit/position/position_core.js
@@ -221,7 +221,7 @@ test( "of", function() {
});
test( "offsets", function() {
- expect( 4 );
+ expect( 7 );
$( "#elx" ).position({
my: "left top",
@@ -254,6 +254,30 @@ test( "offsets", function() {
collision: "none"
});
deepEqual( $( "#elx" ).offset(), { top: 65, left: 37 }, "percentage offsets in my" );
+
+ $( "#elx" ).position({
+ my: "left-30.001% top+50.0%",
+ at: "left bottom",
+ of: "#parentx",
+ collision: "none"
+ });
+ deepEqual( $( "#elx" ).offset(), { top: 65, left: 37 }, "decimal percentage offsets in my" );
+
+ $( "#elx" ).position({
+ my: "left+10.4 top-10.6",
+ at: "left bottom",
+ of: "#parentx",
+ collision: "none"
+ });
+ deepEqual( $( "#elx" ).offset(), { top: 49, left: 50 }, "decimal offsets in my" );
+
+ $( "#elx" ).position({
+ my: "left+right top-left",
+ at: "left-top bottom-bottom",
+ of: "#parentx",
+ collision: "none"
+ });
+ deepEqual( $( "#elx" ).offset(), { top: 60, left: 40 }, "invalid offsets" );
});
test( "using", function() {