diff --git a/tests/unit/resizable/resizable_core.js b/tests/unit/resizable/resizable_core.js index f0b5cea20e1..f43cde6237c 100644 --- a/tests/unit/resizable/resizable_core.js +++ b/tests/unit/resizable/resizable_core.js @@ -171,13 +171,14 @@ test("handle with complex markup (#8756)", function() { }); test("resizable accounts for scroll position correctly (#3815)", function() { - expect( 3 ); + expect( 4 ); var position, top, left, container = $("
").appendTo("#qunit-fixture"), overflowed = $("").appendTo( container ), el = $("").appendTo( overflowed ).resizable({ handles: "all" }), - handle = ".ui-resizable-e"; + handle = ".ui-resizable-e", + handlePosition = $(handle).position().left; container.scrollLeft( 100 ).scrollTop( 100 ); @@ -189,6 +190,7 @@ test("resizable accounts for scroll position correctly (#3815)", function() { deepEqual( el.position(), position, "position stays the same when resized" ); equal( el.css("left"), left, "css('left') stays the same when resized" ); equal( el.css("top"), top, "css('top') stays the same when resized" ); + equal( $(handle).position().left, handlePosition + 50, "handle also moved" ); }); test( "resizable stores correct size when using helper and grid (#9547)", function() { @@ -208,7 +210,7 @@ test( "resizable stores correct size when using helper and grid (#9547)", functi test( "nested resizable", function() { expect( 4 ); - + var outer = $( "" ), inner = $( "" ), target = $( "#resizable1" ), @@ -224,7 +226,7 @@ test( "nested resizable", function() { innerHandle = $( "#inner > .ui-resizable-e" ); outerHandle = $( "#outer > .ui-resizable-e" ); - + TestHelpers.resizable.drag( innerHandle, 10 ); equal( inner.width(), 40, "compare width of inner element" ); TestHelpers.resizable.drag( innerHandle, -10 ); diff --git a/tests/visual/compound/draggable_resizable.html b/tests/visual/compound/draggable_resizable.html new file mode 100644 index 00000000000..d383994314d --- /dev/null +++ b/tests/visual/compound/draggable_resizable.html @@ -0,0 +1,51 @@ + + + + +WHAT: Three draggable and resizable elements, with only a bottom handle. Last one (red color) is absolutely positioned.
+EXPECTED: Each element can be dragged and resized. The first two stay with their relative positioning (induced by draggable). The last one can be resized despite the absolute positioning.
+ +