aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/position/position_core.js
diff options
context:
space:
mode:
authorThomas Meyer <meyertee@gmail.com>2013-09-04 23:20:45 +0200
committerScott González <scott.gonzalez@gmail.com>2015-01-09 15:10:06 -0500
commit4de983c6d5eacbdc668c0b7280d9818dd6281a53 (patch)
tree3199df9fde1a4ff7080bc794607e21ecdf3c45df /tests/unit/position/position_core.js
parentebaaca7206cae201ec069dbaed85bc8d6beeab32 (diff)
downloadjquery-ui-4de983c6d5eacbdc668c0b7280d9818dd6281a53.tar.gz
jquery-ui-4de983c6d5eacbdc668c0b7280d9818dd6281a53.zip
Position: Add unit tests for bug 8710
Ref #8710 Closes gh-1071
Diffstat (limited to 'tests/unit/position/position_core.js')
-rw-r--r--tests/unit/position/position_core.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/unit/position/position_core.js b/tests/unit/position/position_core.js
index 5b1872af9..7176e37e1 100644
--- a/tests/unit/position/position_core.js
+++ b/tests/unit/position/position_core.js
@@ -726,4 +726,41 @@ test( "bug #5280: consistent results (avoid fractional values)", function() {
deepEqual( offset1, offset2 );
});
+test( "bug #8710: flip if flipped position fits more", function() {
+ expect( 3 );
+
+ // Positions a 10px tall element within 99px height at top 90px.
+ collisionTest({
+ within: "#bug-8710-within-smaller",
+ of: "#parentx",
+ collision: "flip",
+ at: "right bottom+30"
+ }, {
+ top: 0,
+ left: 60
+ }, "flip - top fits all" );
+
+ // Positions a 10px tall element within 99px height at top 92px.
+ collisionTest({
+ within: "#bug-8710-within-smaller",
+ of: "#parentx",
+ collision: "flip",
+ at: "right bottom+32"
+ }, {
+ top: -2,
+ left: 60
+ }, "flip - top fits more" );
+
+ // Positions a 10px tall element within 101px height at top 92px.
+ collisionTest({
+ within: "#bug-8710-within-bigger",
+ of: "#parentx",
+ collision: "flip",
+ at: "right bottom+32"
+ }, {
+ top: 92,
+ left: 60
+ }, "no flip - top fits less" );
+});
+
}( jQuery ) );