aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2012-04-24 16:17:02 +0200
committerJörn Zaefferer <joern.zaefferer@gmail.com>2012-04-24 16:17:02 +0200
commit1a0f2e46593ec9e3fbca51175d342210a9996fba (patch)
treee2c5b87ca51d7f81271e1b22df457d752e81ea94 /tests
parent0f575e03bb9af0b09d18a9207d9f589e05f44d50 (diff)
downloadjquery-ui-1a0f2e46593ec9e3fbca51175d342210a9996fba.tar.gz
jquery-ui-1a0f2e46593ec9e3fbca51175d342210a9996fba.zip
Position: Extend unit test for using to check feedback properties
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/position/position_core.js30
1 files changed, 26 insertions, 4 deletions
diff --git a/tests/unit/position/position_core.js b/tests/unit/position/position_core.js
index 0ebcabef3..b567b7299 100644
--- a/tests/unit/position/position_core.js
+++ b/tests/unit/position/position_core.js
@@ -255,11 +255,30 @@ test( "offsets", function() {
});
test( "using", function() {
- expect( 6 );
+ expect( 10 );
var count = 0,
elems = $( "#el1, #el2" ),
- expectedPosition = { top: 40, left: 40 },
+ of = $( "#parentx" ),
+ expectedPosition = { top: 60, left: 60 },
+ expectedFeedback = {
+ target: {
+ element: of,
+ width: 20,
+ height: 20,
+ left: 40,
+ top: 40
+ },
+ element: {
+ width: 6,
+ height: 6,
+ left: 60,
+ top: 60
+ },
+ horizontal: "left",
+ vertical: "top",
+ important: "vertical"
+ },
originalPosition = elems.position({
my: "right bottom",
at: "rigt bottom",
@@ -269,11 +288,14 @@ test( "using", function() {
elems.position({
my: "left top",
- at: "left top",
+ at: "center+10 bottom",
of: "#parentx",
- using: function( position ) {
+ using: function( position, feedback ) {
deepEqual( this, elems[ count ], "correct context for call #" + count );
deepEqual( position, expectedPosition, "correct position for call #" + count );
+ deepEqual( feedback.element.element[ 0 ], elems[ count ] );
+ delete feedback.element.element;
+ deepEqual( feedback, expectedFeedback );
count++;
}
});