From 3c2a4f57affea3da49e0e3ca1a3c73e31180ede0 Mon Sep 17 00:00:00 2001 From: Eduardo Lundgren Date: Fri, 30 May 2008 04:35:54 +0000 Subject: [PATCH] Start simulating tests with userAction combined with Richard's animated cursor --- ui/tests/resizable.html | 140 ++++------------------------------------ ui/tests/resizable.js | 65 ++++++++++++------- 2 files changed, 55 insertions(+), 150 deletions(-) diff --git a/ui/tests/resizable.html b/ui/tests/resizable.html index b6df6e364..4580fbf2d 100644 --- a/ui/tests/resizable.html +++ b/ui/tests/resizable.html @@ -14,142 +14,28 @@ + + +

jQuery Test Suite

-

+

I'm a resizable.
    - - - - - +
    - - - + \ No newline at end of file diff --git a/ui/tests/resizable.js b/ui/tests/resizable.js index 0ed3e1e9b..d561f32a6 100644 --- a/ui/tests/resizable.js +++ b/ui/tests/resizable.js @@ -1,45 +1,64 @@ var console = console || { log: function(l) { - $('#log').append(l + '
    '); + $('#log').append(l + '
    ').get(0).scrollTop = 10000; } }; +var animateClick = function(co) { + var img = $("").appendTo("body") + .css({ position: "absolute", zIndex: 1000, left: co.x, top: co.y }) + .animate({ width: 80, height: 80, left: co.x-40, top: co.y-40, opacity: 'hide' }, 1000, function() { $(this).remove(); }); + }; + var num = function(i) { return parseInt(i, 10); }; - $(document).ready(function() { - $("#resizable1").resizable({ - - //maxHeight: 200, - - start: function(e, ui) { - //console.log('start: [' + e.pageX + ', ' + e.pageY + ']' ) - //console.log(ui.instance.size, ui.instance.position) - }, - - stop: function(e, ui) { - //console.log('stop: [' + e.pageX + ', ' + e.pageY + ']' ) - //console.log(ui.instance.size, ui.instance.position) - }, - - resize: function(e) { - //console.log(e); + + $('#resizable1').resizable({ + resize: function() { + //console.log('resize') } }); + $('.ui-resizable-se').userAction("drag", 100); + $('.ui-resizable-se').userAction("drag", 200, 50); + $('.ui-resizable-se').userAction("drag", 400); + $('.ui-resizable-se').userAction("drag", -600, -30); - return; - + return; + module("resizable: simple resize"); - test("simple drag", function() { + test("simple resize x", function() { - expect(1); - ok(true, "Resize element on the same position"); + $('#resizable1').resizable({ + resize: function() { + console.log('resize') + } + }); + + $('.ui-resizable-e').userAction("drag", 100); + $('.ui-resizable-e').userAction("drag", 200); + $('.ui-resizable-e').userAction("drag", 200); + + //expect(2); + //ok(false, "Resize element on the same position"); + }); + + /*test("autoheight", function() { + $('#navigation').accordion({ header: '.head', autoheight: false }); + equals( 90, $('#navigation ul:first').height() ); + equals( 126, $('#navigation ul:eq(1)').height() ); + equals( 54, $('#navigation ul:last').height() ); + $('#navigation').accordion("destroy").accordion({ header: '.head',autoheight: true }); + equals( 126, $('#navigation ul:first').height() ); + equals( 126, $('#navigation ul:eq(1)').height() ); + equals( 126, $('#navigation ul:last').height() ); + });*/ }); \ No newline at end of file -- 2.39.5