aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-04-23 16:07:58 -0400
committerScott González <scott.gonzalez@gmail.com>2012-04-23 16:07:58 -0400
commit9df981d268b4029065247cf230a4e988946b7799 (patch)
tree8b8ad46905d5f8eabf6f66f477c57dc257c26f88 /tests
parentb093b6f6f74e20f37689cc9a9447e2f2ae75c2f0 (diff)
downloadjquery-ui-9df981d268b4029065247cf230a4e988946b7799.tar.gz
jquery-ui-9df981d268b4029065247cf230a4e988946b7799.zip
Position: Added tests for flipfit.
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/position/position_core.js60
1 files changed, 57 insertions, 3 deletions
diff --git a/tests/unit/position/position_core.js b/tests/unit/position/position_core.js
index 7a9a35132..0ebcabef3 100644
--- a/tests/unit/position/position_core.js
+++ b/tests/unit/position/position_core.js
@@ -387,6 +387,44 @@ test( "collision: flip, collision", function() {
}, "with offset" );
});
+test( "collision: flipfit, no collision", function() {
+ expect( 2 );
+
+ collisionTest({
+ collision: "flipfit"
+ }, {
+ top: 10,
+ left: 10
+ }, "no offset" );
+
+ collisionTest({
+ collision: "flipfit",
+ at: "right+2 bottom+3"
+ }, {
+ top: 13,
+ left: 12
+ }, "with offset" );
+});
+
+test( "collision: flipfit, collision", function() {
+ expect( 2 );
+
+ collisionTest2({
+ collision: "flipfit"
+ }, {
+ top: 10,
+ left: 10
+ }, "no offset" );
+
+ collisionTest2({
+ collision: "flipfit",
+ at: "left+2 top+3"
+ }, {
+ top: 7,
+ left: 8
+ }, "with offset" );
+});
+
test( "collision: none, no collision", function() {
expect( 2 );
@@ -480,7 +518,7 @@ test( "collision: flip, with margin", function() {
});
test( "within", function() {
- expect( 4 );
+ expect( 6 );
collisionTest({
within: "#within",
@@ -504,7 +542,7 @@ test( "within", function() {
}, {
top: 10,
left: -6
- }, "fit - right bottom" );
+ }, "flip - right bottom" );
collisionTest2({
within: "#within",
@@ -512,7 +550,23 @@ test( "within", function() {
}, {
top: 10,
left: -6
- }, "fit - left top" );
+ }, "flip - left top" );
+
+ collisionTest({
+ within: "#within",
+ collision: "flipfit"
+ }, {
+ top: 4,
+ left: 0
+ }, "flipfit - right bottom" );
+
+ collisionTest2({
+ within: "#within",
+ collision: "flipfit"
+ }, {
+ top: 4,
+ left: 0
+ }, "flipfit - left top" );
});
test( "fractions", function() {