diff options
-rw-r--r-- | tests/all_2.html | 82 | ||||
-rw-r--r-- | tests/datepicker.html | 30 | ||||
-rw-r--r-- | tests/dialog.html | 26 | ||||
-rw-r--r-- | tests/droppable.html | 27 | ||||
-rw-r--r-- | tests/progressbar.html | 24 | ||||
-rw-r--r-- | tests/resizable.html | 25 | ||||
-rw-r--r-- | tests/selectable.html | 30 | ||||
-rw-r--r-- | tests/simulate/jquery.simulate.js | 152 | ||||
-rw-r--r-- | tests/slider.html | 27 | ||||
-rw-r--r-- | tests/sortable.html | 30 | ||||
-rw-r--r-- | tests/ui.html | 34 | ||||
-rw-r--r-- | tests/ui.js | 36 | ||||
-rw-r--r-- | tests/unit/accordion/accordion.html (renamed from tests/accordion.html) | 14 | ||||
-rw-r--r-- | tests/unit/accordion/accordion.js (renamed from tests/accordion.js) | 0 | ||||
-rw-r--r-- | tests/unit/all/all.html (renamed from tests/all.html) | 449 | ||||
-rw-r--r-- | tests/unit/all/all_2.html | 82 | ||||
-rw-r--r-- | tests/unit/core/core.html (renamed from tests/core.html) | 12 | ||||
-rw-r--r-- | tests/unit/core/core.js (renamed from tests/core.js) | 0 | ||||
-rw-r--r-- | tests/unit/datepicker/datepicker.html | 30 | ||||
-rw-r--r-- | tests/unit/datepicker/datepicker.js (renamed from tests/datepicker.js) | 0 | ||||
-rw-r--r-- | tests/unit/dialog/dialog.html | 26 | ||||
-rw-r--r-- | tests/unit/dialog/dialog.js (renamed from tests/dialog.js) | 1446 | ||||
-rw-r--r-- | tests/unit/draggable/draggable.html (renamed from tests/draggable.html) | 14 | ||||
-rw-r--r-- | tests/unit/draggable/draggable.js (renamed from tests/draggable.js) | 0 | ||||
-rw-r--r-- | tests/unit/droppable/droppable.html | 27 | ||||
-rw-r--r-- | tests/unit/droppable/droppable.js (renamed from tests/droppable.js) | 0 | ||||
-rw-r--r-- | tests/unit/progressbar/progressbar.html | 24 | ||||
-rw-r--r-- | tests/unit/progressbar/progressbar.js (renamed from tests/progressbar.js) | 0 | ||||
-rw-r--r-- | tests/unit/resizable/images/test.jpg (renamed from tests/images/test.jpg) | bin | 915 -> 915 bytes | |||
-rw-r--r-- | tests/unit/resizable/resizable.html | 25 | ||||
-rw-r--r-- | tests/unit/resizable/resizable.js (renamed from tests/resizable.js) | 0 | ||||
-rw-r--r-- | tests/unit/selectable/selectable.html | 30 | ||||
-rw-r--r-- | tests/unit/selectable/selectable.js (renamed from tests/selectable.js) | 0 | ||||
-rw-r--r-- | tests/unit/slider/slider.html | 27 | ||||
-rw-r--r-- | tests/unit/slider/slider.js (renamed from tests/slider.js) | 0 | ||||
-rw-r--r-- | tests/unit/sortable/sortable.html | 30 | ||||
-rw-r--r-- | tests/unit/sortable/sortable.js (renamed from tests/sortable.js) | 0 | ||||
-rw-r--r-- | tests/unit/tabs/tabs.html (renamed from tests/tabs.html) | 19 | ||||
-rw-r--r-- | tests/unit/tabs/tabs.js (renamed from tests/tabs.js) | 0 | ||||
-rw-r--r-- | tests/unit/testsuite.css (renamed from tests/testsuite.css) | 2 | ||||
-rw-r--r-- | tests/unit/testsuite.js (renamed from tests/testsuite.js) | 0 |
41 files changed, 1279 insertions, 1501 deletions
diff --git a/tests/all_2.html b/tests/all_2.html deleted file mode 100644 index 42d86d39d..000000000 --- a/tests/all_2.html +++ /dev/null @@ -1,82 +0,0 @@ -<!doctype html> -<html lang="en"> -<head> - <title>jQuery UI All Tests</title> - <link rel="stylesheet" href="qunit/testsuite.css" type="text/css"> - - <script type="text/javascript" src="../jquery-1.3pre.js"></script> - <script type="text/javascript" src="../ui/ui.core.js"></script> - - <script type="text/javascript"> - var components = ["accordion","datepicker","dialog","draggable","progressbar","resizable","selectable","slider","sortable","tabs"]; - - $(function() { - - var $list = $("#individual_list"), - $main = $("#main"); - - $.each(components, function(i, val){ - $list.append('<li><a href="' + val + '.html">' + val + '</a></li>'); - $('<div class="component_panel" id="' + val + '">').appendTo($main); - $('#' + val).load(val + '.html #main *'); - }); - - loadScripts(); - - function loadScripts() { - if ( $("div.component_panel").length == components.length ) { - $.each(components, function(i, val){ - $('head').append('<script type="text/javascript" src="' + val + '.js"></scr'+'ipt>'); - }); - } else { - setTimeout(loadScripts, 10); - } - } - - - }); - - - </script> - - <script type="text/javascript" src="../ui/ui.accordion.js"></script> - <script type="text/javascript" src="../ui/ui.datepicker.js"></script> - <script type="text/javascript" src="../ui/ui.dialog.js"></script> - <script type="text/javascript" src="../ui/ui.draggable.js"></script> - <script type="text/javascript" src="../ui/ui.droppable.js"></script> - <script type="text/javascript" src="../ui/ui.progressbar.js"></script> - <script type="text/javascript" src="../ui/ui.resizable.js"></script> - <script type="text/javascript" src="../ui/ui.selectable.js"></script> - <script type="text/javascript" src="../ui/ui.slider.js"></script> - <script type="text/javascript" src="../ui/ui.sortable.js"></script> - <script type="text/javascript" src="../ui/ui.tabs.js"></script> - - <script type="text/javascript" src="qunit/testrunner.js"></script> - <script type="text/javascript" src="simulate/jquery.simulate.js"></script> - <script type="text/javascript" src="plugins/cookie/jquery.cookie.js"></script> - - <style type="text/css"> - @import "../themes/base/ui.datepicker.css"; - .xerror, .error, .ui-tabs-hide { - display: none; - } - </style> - -</head> -<body> - <h1>jQuery UI All Tests</h1> - <h2 id="banner"></h2> - <h2 id="userAgent"></h2> - - <h4>Run individual testsuites or doubleclick a test below</h4> - <ul id="individual_list"> - </ul> - - <ol id="tests"></ol> - - <div id="main" style="position:absolute; top:-2000000px;"> - - </div> - - </body> -</html>
\ No newline at end of file diff --git a/tests/datepicker.html b/tests/datepicker.html deleted file mode 100644 index c25f1eae0..000000000 --- a/tests/datepicker.html +++ /dev/null @@ -1,30 +0,0 @@ -<!doctype html> -<html lang="en"> -<head> - <title>jQuery UI Datepicker Test Suite</title> - - <script type="text/javascript" src="../jquery-1.3pre.js"></script> - <script type="text/javascript" src="../ui/ui.core.js"></script> - <script type="text/javascript" src="../ui/ui.datepicker.js"></script> - <script type="text/javascript" src="../ui/i18n/ui.datepicker-fr.js"></script> - <script type="text/javascript" src="../ui/i18n/ui.datepicker-he.js"></script> - - <link type="text/css" href="testsuite.css" rel="stylesheet" /> - <script type="text/javascript" src="testsuite.js"></script> - <script type="text/javascript" src="qunit/testrunner.js"></script> - <script type="text/javascript" src="simulate/jquery.simulate.js"></script> - - <style type="text/css"> - @import "../themes/base/ui.datepicker.css"; - </style> - - <script type="text/javascript" src="datepicker.js"></script> -</head> -<body> - -<div id="main"> - <p><input type="text" id="inp"/><input type="text" id="alt"/><div id="inl"></div></p> -</div> - -</body> -</html> diff --git a/tests/dialog.html b/tests/dialog.html deleted file mode 100644 index 954561cfc..000000000 --- a/tests/dialog.html +++ /dev/null @@ -1,26 +0,0 @@ -<!doctype html> -<html lang="en"> -<head> - <title>jQuery UI Dialog Test Suite</title> - - <script type="text/javascript" src="../jquery-1.3pre.js"></script> - <script type="text/javascript" src="../ui/ui.core.js"></script> - <script type="text/javascript" src="../ui/ui.dialog.js"></script> - <script type="text/javascript" src="../ui/ui.draggable.js"></script> - <script type="text/javascript" src="../ui/ui.resizable.js"></script> - - <link type="text/css" href="testsuite.css" rel="stylesheet" /> - <script type="text/javascript" src="testsuite.js"></script> - <script type="text/javascript" src="qunit/testrunner.js"></script> - <script type="text/javascript" src="simulate/jquery.simulate.js"></script> - - <script type="text/javascript" src="dialog.js"></script> -</head> -<body> - -<div id="main"> - <div id="dialog1">Dialog Content</div> -</div> - -</body> -</html> diff --git a/tests/droppable.html b/tests/droppable.html deleted file mode 100644 index 3646767e4..000000000 --- a/tests/droppable.html +++ /dev/null @@ -1,27 +0,0 @@ -<!doctype html> -<html lang="en"> -<head> - <title>jQuery UI Droppable Test Suite</title> - - <script type="text/javascript" src="../jquery-1.3pre.js"></script> - <script type="text/javascript" src="../ui/ui.core.js"></script> - <script type="text/javascript" src="../ui/ui.draggable.js"></script> - <script type="text/javascript" src="../ui/ui.droppable.js"></script> - - <link type="text/css" href="testsuite.css" rel="stylesheet" /> - <script type="text/javascript" src="testsuite.js"></script> - <script type="text/javascript" src="qunit/testrunner.js"></script> - <script type="text/javascript" src="simulate/jquery.simulate.js"></script> - - <script type="text/javascript" src="droppable.js"></script> -</head> -<body> - -<div id="main"> - <div id="draggable1" style="width: 25px; height: 25px;">Draggable</div> - <div id="droppable1" style="width: 100px; height: 100px;">Droppable</div> - <div style='width:1000px;height:1000px;'> </div> -</div> - -</body> -</html> diff --git a/tests/progressbar.html b/tests/progressbar.html deleted file mode 100644 index ddfe918b0..000000000 --- a/tests/progressbar.html +++ /dev/null @@ -1,24 +0,0 @@ -<!doctype html> -<html lang="en"> -<head> - <title>jQuery UI Progressbar Test Suite</title> - - <script type="text/javascript" src="../jquery-1.3pre.js"></script> - <script type="text/javascript" src="../ui/ui.core.js"></script> - <script type="text/javascript" src="../ui/ui.progressbar.js"></script> - - <link type="text/css" href="testsuite.css" rel="stylesheet" /> - <script type="text/javascript" src="testsuite.js"></script> - <script type="text/javascript" src="qunit/testrunner.js"></script> - <script type="text/javascript" src="simulate/jquery.simulate.js"></script> - - <script type="text/javascript" src="progressbar.js"></script> -</head> -<body> - -<div id="main"> - <div id="progressbar"></div> -</div> - -</body> -</html> diff --git a/tests/resizable.html b/tests/resizable.html deleted file mode 100644 index 8862b7703..000000000 --- a/tests/resizable.html +++ /dev/null @@ -1,25 +0,0 @@ -<!doctype html> -<html lang="en"> -<head> - <title>jQuery UI Resizable Test Suite</title> - - <script type="text/javascript" src="../jquery-1.3pre.js"></script> - <script type="text/javascript" src="../ui/ui.core.js"></script> - <script type="text/javascript" src="../ui/ui.resizable.js"></script> - - <link type="text/css" href="testsuite.css" rel="stylesheet" /> - <script type="text/javascript" src="testsuite.js"></script> - <script type="text/javascript" src="qunit/testrunner.js"></script> - <script type="text/javascript" src="simulate/jquery.simulate.js"></script> - - <script type="text/javascript" src="resizable.js"></script> -</head> -<body> - -<div id="main"> - <div id="resizable1" style="background: green; width: 100px; height: 100px;">I'm a resizable.</div> - <img src="images/test.jpg" id="resizable2" style="width: 100px; height: 100px;"/> -</div> - -</body> -</html> diff --git a/tests/selectable.html b/tests/selectable.html deleted file mode 100644 index 6f83d2bac..000000000 --- a/tests/selectable.html +++ /dev/null @@ -1,30 +0,0 @@ -<!doctype html> -<html lang="en"> -<head> - <title>jQuery UI Selectable Test Suite</title> - - <script type="text/javascript" src="../jquery-1.3pre.js"></script> - <script type="text/javascript" src="../ui/ui.core.js"></script> - <script type="text/javascript" src="../ui/ui.selectable.js"></script> - - <link type="text/css" href="testsuite.css" rel="stylesheet" /> - <script type="text/javascript" src="testsuite.js"></script> - <script type="text/javascript" src="qunit/testrunner.js"></script> - <script type="text/javascript" src="simulate/jquery.simulate.js"></script> - - <script type="text/javascript" src="selectable.js"></script> -</head> -<body> - -<div id="main"> - <ul id="selectable1"> - <li>Item 1</li> - <li>Item 2</li> - <li class="special">Item 3</li> - <li>Item 4</li> - <li>Item 5</li> - </ul> -</div> - -</body> -</html> diff --git a/tests/simulate/jquery.simulate.js b/tests/simulate/jquery.simulate.js deleted file mode 100644 index d52140bb8..000000000 --- a/tests/simulate/jquery.simulate.js +++ /dev/null @@ -1,152 +0,0 @@ -/* - * jquery.simulate - simulate browser mouse and keyboard events - * - * Copyright (c) 2009 Eduardo Lundgren (eduardolundgren@gmail.com) - * and Richard D. Worth (rdworth@gmail.com) - * - * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) - * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses. - * - */ - -;(function($) { - -$.fn.extend({ - simulate: function(type, options) { - return this.each(function() { - var opt = $.extend({}, $.simulate.defaults, options || {}); - new $.simulate(this, type, opt); - }); - } -}); - -$.simulate = function(el, type, options) { - this.target = el; - this.options = options; - - if (/^drag$/.test(type)) { - this[type].apply(this, [this.target, options]); - } else { - this.simulateEvent(el, type, options); - } -} - -$.extend($.simulate.prototype, { - simulateEvent: function(el, type, options) { - var evt = this.createEvent(type, options); - this.dispatchEvent(el, type, evt, options); - return evt; - }, - createEvent: function(type, options) { - if (/^mouse(over|out|down|up|move)|(dbl)?click$/.test(type)) { - return this.mouseEvent(type, options); - } else if (/^key(up|down|press)$/.test(type)) { - return this.keyboardEvent(type, options); - } - }, - mouseEvent: function(type, options) { - var evt; - var e = $.extend({ - bubbles: true, cancelable: (type != "mousemove"), view: window, detail: 0, - screenX: 0, screenY: 0, clientX: 0, clientY: 0, - ctrlKey: false, altKey: false, shiftKey: false, metaKey: false, - button: 0, relatedTarget: undefined - }, options); - - var relatedTarget = $(e.relatedTarget)[0]; - - if ($.isFunction(document.createEvent)) { - evt = document.createEvent("MouseEvents"); - evt.initMouseEvent(type, e.bubbles, e.cancelable, e.view, e.detail, - e.screenX, e.screenY, e.clientX, e.clientY, - e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, - e.button, e.relatedTarget || document.body.parentNode); - } else if (document.createEventObject) { - evt = document.createEventObject(); - $.extend(evt, e); - evt.button = { 0:1, 1:4, 2:2 }[evt.button] || evt.button; - } - return evt; - }, - keyboardEvent: function(type, options) { - var evt; - - var e = $.extend({ bubbles: true, cancelable: true, view: window, - ctrlKey: false, altKey: false, shiftKey: false, metaKey: false, - keyCode: 0, charCode: 0 - }, options); - - if ($.isFunction(document.createEvent)) { - try { - evt = document.createEvent("KeyEvents"); - evt.initKeyEvent(type, e.bubbles, e.cancelable, e.view, - e.ctrlKey, e.altKey, e.shiftKey, e.metaKey, - e.keyCode, e.charCode); - } catch(err) { - evt = document.createEvent("Events"); - evt.initEvent(type, e.bubbles, e.cancelable); - $.extend(evt, { view: e.view, - ctrlKey: e.ctrlKey, altKey: e.altKey, shiftKey: e.shiftKey, metaKey: e.metaKey, - keyCode: e.keyCode, charCode: e.charCode - }); - } - } else if (document.createEventObject) { - evt = document.createEventObject(); - $.extend(evt, e); - } - if ($.browser.msie || $.browser.opera) { - evt.keyCode = (e.charCode > 0) ? e.charCode : e.keyCode; - evt.charCode = undefined; - } - return evt; - }, - - dispatchEvent: function(el, type, evt) { - if (el.dispatchEvent) { - el.dispatchEvent(evt); - } else if (el.fireEvent) { - el.fireEvent('on' + type, evt); - } - return evt; - }, - - drag: function(el) { - var self = this, center = this.findCenter(this.target), - options = this.options, x = Math.floor(center.x), y = Math.floor(center.y), - dx = options.dx || 0, dy = options.dy || 0, target = this.target; - var coord = { clientX: x, clientY: y }; - this.simulateEvent(target, "mousedown", coord); - coord = { clientX: x + 1, clientY: y + 1 }; - this.simulateEvent(document, "mousemove", coord); - coord = { clientX: x + dx, clientY: y + dy }; - this.simulateEvent(document, "mousemove", coord); - this.simulateEvent(document, "mousemove", coord); - this.simulateEvent(target, "mouseup", coord); - }, - findCenter: function(el) { - var el = $(this.target), o = el.offset(); - return { - x: o.left + el.outerWidth() / 2, - y: o.top + el.outerHeight() / 2 - }; - } -}); - -$.extend($.simulate, { - defaults: { - speed: 'sync' - }, - VK_TAB: 9, - VK_ENTER: 13, - VK_ESC: 27, - VK_PGUP: 33, - VK_PGDN: 34, - VK_END: 35, - VK_HOME: 36, - VK_LEFT: 37, - VK_UP: 38, - VK_RIGHT: 39, - VK_DOWN: 40 -}); - -})(jQuery); diff --git a/tests/slider.html b/tests/slider.html deleted file mode 100644 index e21705be8..000000000 --- a/tests/slider.html +++ /dev/null @@ -1,27 +0,0 @@ -<!doctype html> -<html lang="en"> -<head> - <title>jQuery UI Slider Test Suite</title> - - <script type="text/javascript" src="../jquery-1.3pre.js"></script> - <script type="text/javascript" src="../ui/ui.core.js"></script> - <script type="text/javascript" src="../ui/ui.slider.js"></script> - - <link type="text/css" href="testsuite.css" rel="stylesheet" /> - <script type="text/javascript" src="testsuite.js"></script> - <script type="text/javascript" src="qunit/testrunner.js"></script> - <script type="text/javascript" src="simulate/jquery.simulate.js"></script> - - <script type="text/javascript" src="slider.js"></script> -</head> -<body> - -<div id="main"> - <div id="slider1"></div> - <div id="slider3" style="position: relative; margin: 40px; width: 217px; height: 28px;"> - <div class="ui-slider-handle" style="position: absolute; height: 21px; left: 0px; bottom: 0px; width: 17px;"></div> - </div> -</div> - -</body> -</html> diff --git a/tests/sortable.html b/tests/sortable.html deleted file mode 100644 index 190aa5763..000000000 --- a/tests/sortable.html +++ /dev/null @@ -1,30 +0,0 @@ -<!doctype html> -<html lang="en"> -<head> - <title>jQuery UI Sortable Test Suite</title> - - <script type="text/javascript" src="../jquery-1.3pre.js"></script> - <script type="text/javascript" src="../ui/ui.core.js"></script> - <script type="text/javascript" src="../ui/ui.sortable.js"></script> - - <link type="text/css" href="testsuite.css" rel="stylesheet" /> - <script type="text/javascript" src="testsuite.js"></script> - <script type="text/javascript" src="qunit/testrunner.js"></script> - <script type="text/javascript" src="simulate/jquery.simulate.js"></script> - - <script type="text/javascript" src="sortable.js"></script> -</head> -<body> - -<div id="main"> - <ul id="sortable"> - <li>Item 1</li> - <li>Item 2</li> - <li>Item 3</li> - <li>Item 4</li> - <li>Item 5</li> - </ul> -</div> - -</body> -</html> diff --git a/tests/ui.html b/tests/ui.html deleted file mode 100644 index b29834cc4..000000000 --- a/tests/ui.html +++ /dev/null @@ -1,34 +0,0 @@ -<!doctype html> -<html lang="en"> -<head> - <title>jQuery UI Test Suite</title> - - <script type="text/javascript" src="../jquery-1.3pre.js"></script> - <script type="text/javascript" src="../ui/ui.core.js"></script> - <script type="text/javascript" src="../ui/ui.accordion.js"></script> - <script type="text/javascript" src="../ui/ui.datepicker.js"></script> - <script type="text/javascript" src="../ui/ui.dialog.js"></script> - <script type="text/javascript" src="../ui/ui.draggable.js"></script> - <script type="text/javascript" src="../ui/ui.droppable.js"></script> - <script type="text/javascript" src="../ui/ui.progressbar.js"></script> - <script type="text/javascript" src="../ui/ui.resizable.js"></script> - <script type="text/javascript" src="../ui/ui.selectable.js"></script> - <script type="text/javascript" src="../ui/ui.slider.js"></script> - <script type="text/javascript" src="../ui/ui.sortable.js"></script> - <script type="text/javascript" src="../ui/ui.tabs.js"></script> - - <link type="text/css" href="testsuite.css" rel="stylesheet" /> - <script type="text/javascript" src="testsuite.js"></script> - <script type="text/javascript" src="qunit/testrunner.js"></script> - <script type="text/javascript" src="simulate/jquery.simulate.js"></script> - - <script type="text/javascript" src="ui.js"></script> -</head> -<body> - -<div id="main"> - -</div> - -</body> -</html> diff --git a/tests/ui.js b/tests/ui.js deleted file mode 100644 index 03bbf405e..000000000 --- a/tests/ui.js +++ /dev/null @@ -1,36 +0,0 @@ -/* - * common UI unit tests - */ -(function($) { - -var plugins = [ - "accordion", - "datepicker", - "dialog", - "draggable", - "droppable", - "progressbar", - "resizable", - "selectable", - "slider", - "sortable", - "tabs" -]; - -module("version"); - -test("core", function() { - equals($.ui.version, "@VERSION", "$.ui.version"); -}); - -$(plugins).each(function() { - var pluginName = this; - test(pluginName, function() { - if ($.ui[pluginName]) - equals($.ui[pluginName].version, "@VERSION", "$.ui." + pluginName + ".version"); - else - ok(false, "$.ui." + pluginName + " undefined."); - }); -}); - -})(jQuery); diff --git a/tests/accordion.html b/tests/unit/accordion/accordion.html index e22d753b4..51553d330 100644 --- a/tests/accordion.html +++ b/tests/unit/accordion/accordion.html @@ -3,14 +3,14 @@ <head> <title>jQuery UI Accordion Test Suite</title> - <script type="text/javascript" src="../jquery-1.3pre.js"></script> - <script type="text/javascript" src="../ui/ui.core.js"></script> - <script type="text/javascript" src="../ui/ui.accordion.js"></script> + <script type="text/javascript" src="../../../jquery-1.3pre.js"></script> + <script type="text/javascript" src="../../../ui/ui.core.js"></script> + <script type="text/javascript" src="../../../ui/ui.accordion.js"></script> - <link type="text/css" href="testsuite.css" rel="stylesheet" /> - <script type="text/javascript" src="testsuite.js"></script> - <script type="text/javascript" src="qunit/testrunner.js"></script> - <script type="text/javascript" src="simulate/jquery.simulate.js"></script> + <link type="text/css" href="../testsuite.css" rel="stylesheet" /> + <script type="text/javascript" src="../testsuite.js"></script> + <script type="text/javascript" src="../../../external/qunit/testrunner.js"></script> + <script type="text/javascript" src="../../../external/simulate/jquery.simulate.js"></script> <script type="text/javascript" src="accordion.js"></script> </head> diff --git a/tests/accordion.js b/tests/unit/accordion/accordion.js index d9f8c4b64..d9f8c4b64 100644 --- a/tests/accordion.js +++ b/tests/unit/accordion/accordion.js diff --git a/tests/all.html b/tests/unit/all/all.html index af23bad42..358cc3e52 100644 --- a/tests/all.html +++ b/tests/unit/all/all.html @@ -1,225 +1,226 @@ -<!doctype html> -<html lang="en"> -<head> - <title>jQuery UI All Tests</title> - <link rel="stylesheet" href="qunit/testsuite.css" type="text/css"> - - <script type="text/javascript" src="../jquery-1.3pre.js"></script> - <script type="text/javascript" src="../ui/ui.core.js"></script> - <script type="text/javascript" src="../ui/ui.accordion.js"></script> - <script type="text/javascript" src="../ui/ui.datepicker.js"></script> - <script type="text/javascript" src="../ui/ui.dialog.js"></script> - <script type="text/javascript" src="../ui/ui.draggable.js"></script> - <script type="text/javascript" src="../ui/ui.droppable.js"></script> - <script type="text/javascript" src="../ui/ui.progressbar.js"></script> - <script type="text/javascript" src="../ui/ui.resizable.js"></script> - <script type="text/javascript" src="../ui/ui.selectable.js"></script> - <script type="text/javascript" src="../ui/ui.slider.js"></script> - <script type="text/javascript" src="../ui/ui.sortable.js"></script> - <script type="text/javascript" src="../ui/ui.tabs.js"></script> - - <script type="text/javascript" src="qunit/testrunner.js"></script> - <script type="text/javascript" src="simulate/jquery.simulate.js"></script> - <script type="text/javascript" src="plugins/cookie/jquery.cookie.js"></script> - - <script type="text/javascript" src="accordion.js"></script> - <script type="text/javascript" src="datepicker.js"></script> - <script type="text/javascript" src="dialog.js"></script> - <script type="text/javascript" src="draggable.js"></script> - <script type="text/javascript" src="progressbar.js"></script> - <script type="text/javascript" src="resizable.js"></script> - <script type="text/javascript" src="selectable.js"></script> - <script type="text/javascript" src="slider.js"></script> - <script type="text/javascript" src="sortable.js"></script> - <script type="text/javascript" src="tabs.js"></script> - - <style type="text/css"> - @import "../themes/base/ui.datepicker.css"; - .xerror, .error, .ui-tabs-hide { - display: none; - } - </style> - -</head> -<body> - <h1>jQuery UI All Tests</h1> - <h2 id="banner"></h2> - <h2 id="userAgent"></h2> - - <h4>Run individual testsuites or doubleclick a test below</h4> - <ul> - <li><a href="accordion.html">Accordion</a></li> - <li><a href="datepicker.html">Datepicker</a></li> - <li><a href="dialog.html">Dialog</a></li> - <li><a href="draggable.html">Draggable</a></li> - <li><a href="resizable.html">Resizable</a></li> - <li><a href="selectable.html">Selectable</a></li> - <li><a href="slider.html">Slider</a></li> - <li><a href="sortable.html">Sortable</a></li> - <li><a href="tabs.html">Tabs</a></li> - </ul> - - <ol id="tests"></ol> - - <div id="main" style="position:absolute;top:-2000000px;"> - - <p><input type="text" id="dp1"/><input type="text" id="rem"/></p> - - <div id="draggable1" style="background: green; width: 200px; height: 100px;">Relative</div> - <div id="draggable2" style="background: green; width: 200px; height: 100px; position: absolute; top: 10px; left: 10px;"><span>Absolute</span></div> - - <div id="slider1"></div> - <div id="slider3" style="position: relative; margin: 40px; width: 217px; height: 28px;"> - <div class="ui-slider-handle" style="position: absolute; height: 21px; left: 0px; bottom: 0px; width: 17px;"></div> - </div> - - <div id="list1"> - <a>There is one obvious advantage:</a> - <div> - <p> - You've seen it coming!<br/> - Buy now and get nothing for free!<br/> - Well, at least no free beer. Perhaps a bear, if you can afford it. - </p> - </div> - <a>Now that you've got...</a> - <div> - <p> - your bear, you have to admit it!<br/> - No, we aren't selling bears. - </p> - <p> - We could talk about renting one. - </p> - </div> - <a>Rent one bear, ...</a> - <div> - <p> - get two for three beer. - </p> - <p> - And now, for something completely different. - </p> - </div> - </div> - - <ul id="navigation"> - <li> - <a class="head" href="?p=1.1.1">Guitar</a> - <ul> - <li><a href="?p=1.1.1.1">Electric</a></li> - <li><a href="?p=1.1.1.2">Acoustic</a></li> - <li><a href="?p=1.1.1.3">Amps</a></li> - <li><a href="?p=1.1.1.4">Effects</a></li> - <li><a href="?p=1.1.1.5">Accessories</a></li> - </ul> - </li> - <li> - <a class="head" href="?p=1.1.2"><span>Bass</span></a> - <ul> - <li><a href="?p=1.1.2.1">Electric</a></li> - <li><a href="?p=1.1.2.2">Acoustic</a></li> - <li><a href="?p=1.1.2.3">Amps</a></li> - <li><a href="?p=1.1.2.4">Effects</a></li> - <li><a href="?p=1.1.2.5">Accessories</a></li> - <li><a href="?p=1.1.2.5">Accessories</a></li> - <li><a href="?p=1.1.2.5">Accessories</a></li> - </ul> - </li> - <li> - <a class="head" href="?p=1.1.3">Drums</a> - <ul> - <li><a href="?p=1.1.3.2">Acoustic Drums</a></li> - <li><a href="?p=1.1.3.3">Electronic Drums</a></li> - <li><a href="?p=1.1.3.6">Accessories</a></li> - </ul> - </li> - </ul> - <dl id="list2"> - <dt class="red">Red</dt> - <dd> - Fancy stuff about red thingies. - </dd> - <dt class="green selected">Green</dt> - <dd> - Green! Green! Green! - </dd> - <dt class="blue">Blue</dt> - <dd> - Cool kids are blue. - </dd> - </dl> - - <div id="list3"> - <div> - <div class="title">Tennis</div> - <div> - One ball, two players. Lots of fun. - </div> - </div> - <div> - <div class="title">Soccer</div> - <div> - One ball, 22 players. Lots of fun. - </div> - </div> - <div> - <div class="title">Baseball</div> - <div> - Well, one ball, some guys running around, some guys hitting others with a stick.<br/> - Sounds like fun, doesn't it? - </div> - <div> - Well, apart from the running part. - </div> - </div> - </div> - - <div id="resizable1" style="background: green; width: 100px; height: 100px;">I'm a resizable.</div> - <img src="images/test.jpg" id="resizable2" style="width: 100px; height: 100px;"/> - - - <ul id="selectable1"> - <li>Item 1</li> - <li>Item 2</li> - <li class="special">Item 3</li> - <li>Item 4</li> - <li>Item 5</li> - </ul> - - <ul id="sortable"> - <li>Item 1</li> - <li>Item 2</li> - <li>Item 3</li> - <li>Item 4</li> - <li>Item 5</li> - </ul> - - <p><input type="text" id="inp"/><input type="text" id="alt"/><div id="inl"></div></p> - - <input type="text" id="spin" /> - - <div id="progressbar"></div> - - <div id="tabs1"> - <ul> - <li><a href="#fragment-1">1</a></li> - <li><a href="#fragment-2">2</a></li> - <li><a href="#fragment-3">3</a></li> - </ul> - <div id="fragment-1"></div> - <div id="fragment-2"></div> - <div id="fragment-3"></div> - </div> - <div id="tabs2"> - <ul> - <li><a href="#colon:test">1</a></li> - <li><a href="#inline-style">2</a></li> - </ul> - <div id="colon:test"></div> - <div style="height: 300px;" id="inline-style"></div> - </div> - -</div> - </body> +<!doctype html>
+<html lang="en">
+<head>
+ <title>jQuery UI All Tests</title>
+ <link rel="stylesheet" href="../testsuite.css" type="text/css">
+
+ <script type="text/javascript" src="../../../jquery-1.3pre.js"></script>
+ <script type="text/javascript" src="../../../ui/ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/ui.accordion.js"></script>
+ <script type="text/javascript" src="../../../ui/ui.datepicker.js"></script>
+ <script type="text/javascript" src="../../../ui/ui.dialog.js"></script>
+ <script type="text/javascript" src="../../../ui/ui.draggable.js"></script>
+ <script type="text/javascript" src="../../../ui/ui.droppable.js"></script>
+ <script type="text/javascript" src="../../../ui/ui.progressbar.js"></script>
+ <script type="text/javascript" src="../../../ui/ui.resizable.js"></script>
+ <script type="text/javascript" src="../../../ui/ui.selectable.js"></script>
+ <script type="text/javascript" src="../../../ui/ui.slider.js"></script>
+ <script type="text/javascript" src="../../../ui/ui.sortable.js"></script>
+ <script type="text/javascript" src="../../../ui/ui.tabs.js"></script>
+
+ <script type="text/javascript" src="../../../external/qunit/testrunner.js"></script>
+ <script type="text/javascript" src="../../../external/simulate/jquery.simulate.js"></script>
+ <script type="text/javascript" src="../../../external/cookie/jquery.cookie.js"></script>
+
+ <script type="text/javascript" src="../accordion/accordion.js"></script>
+ <script type="text/javascript" src="../datepicker/datepicker.js"></script>
+ <script type="text/javascript" src="../dialog/dialog.js"></script>
+ <script type="text/javascript" src="../draggable/draggable.js"></script>
+ <script type="text/javascript" src="../droppable/droppable.js"></script>
+ <script type="text/javascript" src="../progressbar/progressbar.js"></script>
+ <script type="text/javascript" src="../resizable/resizable.js"></script>
+ <script type="text/javascript" src="../selectable/selectable.js"></script>
+ <script type="text/javascript" src="../slider/slider.js"></script>
+ <script type="text/javascript" src="../sortable/sortable.js"></script>
+ <script type="text/javascript" src="../tabs/tabs.js"></script>
+
+ <style type="text/css">
+ @import "../../../themes/base/ui.datepicker.css";
+ .xerror, .error, .ui-tabs-hide {
+ display: none;
+ }
+ </style>
+
+</head>
+<body>
+ <h1>jQuery UI All Tests</h1>
+ <h2 id="banner"></h2>
+ <h2 id="userAgent"></h2>
+
+ <h4>Run individual testsuites or doubleclick a test below</h4>
+ <ul>
+ <li><a href="accordion.html">Accordion</a></li>
+ <li><a href="datepicker.html">Datepicker</a></li>
+ <li><a href="dialog.html">Dialog</a></li>
+ <li><a href="draggable.html">Draggable</a></li>
+ <li><a href="resizable.html">Resizable</a></li>
+ <li><a href="selectable.html">Selectable</a></li>
+ <li><a href="slider.html">Slider</a></li>
+ <li><a href="sortable.html">Sortable</a></li>
+ <li><a href="tabs.html">Tabs</a></li>
+ </ul>
+
+ <ol id="tests"></ol>
+
+ <div id="main" style="position:absolute;top:-2000000px;">
+
+ <p><input type="text" id="dp1"/><input type="text" id="rem"/></p>
+
+ <div id="draggable1" style="background: green; width: 200px; height: 100px;">Relative</div>
+ <div id="draggable2" style="background: green; width: 200px; height: 100px; position: absolute; top: 10px; left: 10px;"><span>Absolute</span></div>
+
+ <div id="slider1"></div>
+ <div id="slider3" style="position: relative; margin: 40px; width: 217px; height: 28px;">
+ <div class="ui-slider-handle" style="position: absolute; height: 21px; left: 0px; bottom: 0px; width: 17px;"></div>
+ </div>
+
+ <div id="list1">
+ <a>There is one obvious advantage:</a>
+ <div>
+ <p>
+ You've seen it coming!<br/>
+ Buy now and get nothing for free!<br/>
+ Well, at least no free beer. Perhaps a bear, if you can afford it.
+ </p>
+ </div>
+ <a>Now that you've got...</a>
+ <div>
+ <p>
+ your bear, you have to admit it!<br/>
+ No, we aren't selling bears.
+ </p>
+ <p>
+ We could talk about renting one.
+ </p>
+ </div>
+ <a>Rent one bear, ...</a>
+ <div>
+ <p>
+ get two for three beer.
+ </p>
+ <p>
+ And now, for something completely different.
+ </p>
+ </div>
+ </div>
+
+ <ul id="navigation">
+ <li>
+ <a class="head" href="?p=1.1.1">Guitar</a>
+ <ul>
+ <li><a href="?p=1.1.1.1">Electric</a></li>
+ <li><a href="?p=1.1.1.2">Acoustic</a></li>
+ <li><a href="?p=1.1.1.3">Amps</a></li>
+ <li><a href="?p=1.1.1.4">Effects</a></li>
+ <li><a href="?p=1.1.1.5">Accessories</a></li>
+ </ul>
+ </li>
+ <li>
+ <a class="head" href="?p=1.1.2"><span>Bass</span></a>
+ <ul>
+ <li><a href="?p=1.1.2.1">Electric</a></li>
+ <li><a href="?p=1.1.2.2">Acoustic</a></li>
+ <li><a href="?p=1.1.2.3">Amps</a></li>
+ <li><a href="?p=1.1.2.4">Effects</a></li>
+ <li><a href="?p=1.1.2.5">Accessories</a></li>
+ <li><a href="?p=1.1.2.5">Accessories</a></li>
+ <li><a href="?p=1.1.2.5">Accessories</a></li>
+ </ul>
+ </li>
+ <li>
+ <a class="head" href="?p=1.1.3">Drums</a>
+ <ul>
+ <li><a href="?p=1.1.3.2">Acoustic Drums</a></li>
+ <li><a href="?p=1.1.3.3">Electronic Drums</a></li>
+ <li><a href="?p=1.1.3.6">Accessories</a></li>
+ </ul>
+ </li>
+ </ul>
+ <dl id="list2">
+ <dt class="red">Red</dt>
+ <dd>
+ Fancy stuff about red thingies.
+ </dd>
+ <dt class="green selected">Green</dt>
+ <dd>
+ Green! Green! Green!
+ </dd>
+ <dt class="blue">Blue</dt>
+ <dd>
+ Cool kids are blue.
+ </dd>
+ </dl>
+
+ <div id="list3">
+ <div>
+ <div class="title">Tennis</div>
+ <div>
+ One ball, two players. Lots of fun.
+ </div>
+ </div>
+ <div>
+ <div class="title">Soccer</div>
+ <div>
+ One ball, 22 players. Lots of fun.
+ </div>
+ </div>
+ <div>
+ <div class="title">Baseball</div>
+ <div>
+ Well, one ball, some guys running around, some guys hitting others with a stick.<br/>
+ Sounds like fun, doesn't it?
+ </div>
+ <div>
+ Well, apart from the running part.
+ </div>
+ </div>
+ </div>
+
+ <div id="resizable1" style="background: green; width: 100px; height: 100px;">I'm a resizable.</div>
+ <img src="images/test.jpg" id="resizable2" style="width: 100px; height: 100px;"/>
+
+
+ <ul id="selectable1">
+ <li>Item 1</li>
+ <li>Item 2</li>
+ <li class="special">Item 3</li>
+ <li>Item 4</li>
+ <li>Item 5</li>
+ </ul>
+
+ <ul id="sortable">
+ <li>Item 1</li>
+ <li>Item 2</li>
+ <li>Item 3</li>
+ <li>Item 4</li>
+ <li>Item 5</li>
+ </ul>
+
+ <p><input type="text" id="inp"/><input type="text" id="alt"/><div id="inl"></div></p>
+
+ <input type="text" id="spin" />
+
+ <div id="progressbar"></div>
+
+ <div id="tabs1">
+ <ul>
+ <li><a href="#fragment-1">1</a></li>
+ <li><a href="#fragment-2">2</a></li>
+ <li><a href="#fragment-3">3</a></li>
+ </ul>
+ <div id="fragment-1"></div>
+ <div id="fragment-2"></div>
+ <div id="fragment-3"></div>
+ </div>
+ <div id="tabs2">
+ <ul>
+ <li><a href="#colon:test">1</a></li>
+ <li><a href="#inline-style">2</a></li>
+ </ul>
+ <div id="colon:test"></div>
+ <div style="height: 300px;" id="inline-style"></div>
+ </div>
+
+</div>
+ </body>
</html>
\ No newline at end of file diff --git a/tests/unit/all/all_2.html b/tests/unit/all/all_2.html new file mode 100644 index 000000000..0645acb83 --- /dev/null +++ b/tests/unit/all/all_2.html @@ -0,0 +1,82 @@ +<!doctype html>
+<html lang="en">
+<head>
+ <title>jQuery UI All Tests</title>
+ <link rel="stylesheet" href="../testsuite.css" type="text/css">
+
+ <script type="text/javascript" src="../../../jquery-1.3pre.js"></script>
+ <script type="text/javascript" src="../../../ui/ui.core.js"></script>
+
+ <script type="text/javascript">
+ var components = ["accordion","datepicker","dialog","draggable","progressbar","resizable","selectable","slider","sortable","tabs"];
+
+ $(function() {
+
+ var $list = $("#individual_list"),
+ $main = $("#main");
+
+ $.each(components, function(i, val){
+ $list.append('<li><a href="../' + val + '/' + val + '.html">' + val + '</a></li>');
+ $('<div class="component_panel" id="' + val + '">').appendTo($main);
+ $('#' + val).load(val + '.html #main *');
+ });
+
+ loadScripts();
+
+ function loadScripts() {
+ if ( $("div.component_panel").length == components.length ) {
+ $.each(components, function(i, val){
+ $('head').append('<script type="text/javascript" src="' + val + '.js"></scr'+'ipt>');
+ });
+ } else {
+ setTimeout(loadScripts, 10);
+ }
+ }
+
+
+ });
+
+
+ </script>
+
+ <script type="text/javascript" src="../../../ui/ui.accordion.js"></script>
+ <script type="text/javascript" src="../../../ui/ui.datepicker.js"></script>
+ <script type="text/javascript" src="../../../ui/ui.dialog.js"></script>
+ <script type="text/javascript" src="../../../ui/ui.draggable.js"></script>
+ <script type="text/javascript" src="../../../ui/ui.droppable.js"></script>
+ <script type="text/javascript" src="../../../ui/ui.progressbar.js"></script>
+ <script type="text/javascript" src="../../../ui/ui.resizable.js"></script>
+ <script type="text/javascript" src="../../../ui/ui.selectable.js"></script>
+ <script type="text/javascript" src="../../../ui/ui.slider.js"></script>
+ <script type="text/javascript" src="../../../ui/ui.sortable.js"></script>
+ <script type="text/javascript" src="../../../ui/ui.tabs.js"></script>
+
+ <script type="text/javascript" src="../../../external/qunit/testrunner.js"></script>
+ <script type="text/javascript" src="../../../external/simulate/jquery.simulate.js"></script>
+ <script type="text/javascript" src="../../../cookie/jquery.cookie.js"></script>
+
+ <style type="text/css">
+ @import "../../../themes/base/ui.datepicker.css";
+ .xerror, .error, .ui-tabs-hide {
+ display: none;
+ }
+ </style>
+
+</head>
+<body>
+ <h1>jQuery UI All Tests</h1>
+ <h2 id="banner"></h2>
+ <h2 id="userAgent"></h2>
+
+ <h4>Run individual testsuites or doubleclick a test below</h4>
+ <ul id="individual_list">
+ </ul>
+
+ <ol id="tests"></ol>
+
+ <div id="main" style="position:absolute; top:-2000000px;">
+
+ </div>
+
+ </body>
+</html>
\ No newline at end of file diff --git a/tests/core.html b/tests/unit/core/core.html index 06679794d..c8d88c88a 100644 --- a/tests/core.html +++ b/tests/unit/core/core.html @@ -3,13 +3,13 @@ <head> <title>jQuery UI Core Test Suite</title> - <script type="text/javascript" src="../jquery-1.3pre.js"></script> - <script type="text/javascript" src="../ui/ui.core.js"></script> + <script type="text/javascript" src="../../../jquery-1.3pre.js"></script> + <script type="text/javascript" src="../../../ui/ui.core.js"></script> - <link type="text/css" href="testsuite.css" rel="stylesheet" /> - <script type="text/javascript" src="testsuite.js"></script> - <script type="text/javascript" src="qunit/testrunner.js"></script> - <script type="text/javascript" src="simulate/jquery.simulate.js"></script> + <link type="text/css" href="../testsuite.css" rel="stylesheet" /> + <script type="text/javascript" src="../testsuite.js"></script> + <script type="text/javascript" src="../../../external/qunit/testrunner.js"></script> + <script type="text/javascript" src="../../../external/simulate/jquery.simulate.js"></script> <script type="text/javascript" src="core.js"></script> </head> diff --git a/tests/core.js b/tests/unit/core/core.js index 4be475486..4be475486 100644 --- a/tests/core.js +++ b/tests/unit/core/core.js diff --git a/tests/unit/datepicker/datepicker.html b/tests/unit/datepicker/datepicker.html new file mode 100644 index 000000000..a17b08e90 --- /dev/null +++ b/tests/unit/datepicker/datepicker.html @@ -0,0 +1,30 @@ +<!doctype html> +<html lang="en"> +<head> + <title>jQuery UI Datepicker Test Suite</title> + + <script type="text/javascript" src="../../../jquery-1.3pre.js"></script> + <script type="text/javascript" src="../../../ui/ui.core.js"></script> + <script type="text/javascript" src="../../../ui/ui.datepicker.js"></script> + <script type="text/javascript" src="../../../ui/i18n/ui.datepicker-fr.js"></script> + <script type="text/javascript" src="../../../ui/i18n/ui.datepicker-he.js"></script> + + <link type="text/css" href="../testsuite.css" rel="stylesheet" /> + <script type="text/javascript" src="../testsuite.js"></script> + <script type="text/javascript" src="../../../external/qunit/testrunner.js"></script> + <script type="text/javascript" src="../../../external/simulate/jquery.simulate.js"></script> + + <style type="text/css"> + @import "../../../themes/base/ui.datepicker.css"; + </style> + + <script type="text/javascript" src="datepicker.js"></script> +</head> +<body> + +<div id="main"> + <p><input type="text" id="inp"/><input type="text" id="alt"/><div id="inl"></div></p> +</div> + +</body> +</html> diff --git a/tests/datepicker.js b/tests/unit/datepicker/datepicker.js index dadb5a997..dadb5a997 100644 --- a/tests/datepicker.js +++ b/tests/unit/datepicker/datepicker.js diff --git a/tests/unit/dialog/dialog.html b/tests/unit/dialog/dialog.html new file mode 100644 index 000000000..184430ec7 --- /dev/null +++ b/tests/unit/dialog/dialog.html @@ -0,0 +1,26 @@ +<!doctype html>
+<html lang="en">
+<head>
+ <title>jQuery UI Dialog Test Suite</title>
+
+ <script type="text/javascript" src="../../../jquery-1.3pre.js"></script>
+ <script type="text/javascript" src="../../../ui/ui.core.js"></script>
+ <script type="text/javascript" src="../../../ui/ui.dialog.js"></script>
+ <script type="text/javascript" src="../../../ui/ui.draggable.js"></script>
+ <script type="text/javascript" src="../../../ui/ui.resizable.js"></script>
+
+ <link type="text/css" href="../testsuite.css" rel="stylesheet" />
+ <script type="text/javascript" src="../testsuite.js"></script>
+ <script type="text/javascript" src="../../../external/qunit/testrunner.js"></script>
+ <script type="text/javascript" src="../../../external/simulate/jquery.simulate.js"></script>
+
+ <script type="text/javascript" src="dialog.js"></script>
+</head>
+<body>
+
+<div id="main">
+ <div id="dialog1">Dialog Content</div>
+</div>
+
+</body>
+</html>
diff --git a/tests/dialog.js b/tests/unit/dialog/dialog.js index 25f8b63e9..ff537174b 100644 --- a/tests/dialog.js +++ b/tests/unit/dialog/dialog.js @@ -1,723 +1,723 @@ -/* - * dialog unit tests - */ -(function($) { -// -// Dialog Test Helper Functions -// - -var defaults = { - autoOpen: true, - buttons: {}, - closeOnEscape: true, - closeText: 'close', - disabled: false, - dialogClass: undefined, - draggable: true, - height: 'auto', - maxHeight: undefined, - maxWidth: undefined, - minHeight: 150, - minWidth: 150, - modal: false, - overlay: {}, - position: 'center', - resizable: true, - stack: true, - title: '', - width: 300 -}; - -var el, - offsetBefore, offsetAfter, - heightBefore, heightAfter, - widthBefore, widthAfter, - dragged; - -function dlg() { - return el.data("dialog").element.parents(".ui-dialog:first"); -} - -function isOpen(why) { - ok(dlg().is(":visible"), why); -} - -function isNotOpen(why) { - ok(!dlg().is(":visible"), why); -} - -function drag(handle, dx, dy) { - var d = dlg(); - offsetBefore = d.offset(); - heightBefore = d.height(); - widthBefore = d.width(); - //this mouseover is to work around a limitation in resizable - //TODO: fix resizable so handle doesn't require mouseover in order to be used - $(handle, d).simulate("mouseover"); - $(handle, d).simulate("drag", { - dx: dx || 0, - dy: dy || 0 - }); - dragged = { dx: dx, dy: dy }; - offsetAfter = d.offset(); - heightAfter = d.height(); - widthAfter = d.width(); -} - -function moved(dx, dy, msg) { - msg = msg ? msg + "." : ""; - var actual = { left: offsetAfter.left, top: offsetAfter.top }; - var expected = { left: offsetBefore.left + dx, top: offsetBefore.top + dy }; - same(actual, expected, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ' + msg); -} - -function shouldmove(why) { - var handle = $(".ui-dialog-titlebar", dlg()); - drag(handle, 50, 50); - moved(50, 50, why); -} - -function shouldnotmove(why) { - var handle = $(".ui-dialog-titlebar", dlg()); - drag(handle, 50, 50); - moved(0, 0, why); -} - -function resized(dw, dh, msg) { - msg = msg ? msg + "." : ""; - var actual = { width: widthAfter, height: heightAfter }; - var expected = { width: widthBefore + dw, height: heightBefore + dh }; - same(actual, expected, 'resized[' + dragged.dx + ', ' + dragged.dy + '] ' + msg); -} - -function shouldresize(why) { - var handle = $(".ui-resizable-se", dlg()); - drag(handle, 50, 50); - resized(50, 50, why); -} - -function shouldnotresize(why) { - var handle = $(".ui-resizable-se", dlg()); - drag(handle, 50, 50); - resized(0, 0, why); -} - -function broder(el, side){ - return parseInt(el.css('border-' + side + '-width'), 10); -} - -function margin(el, side) { - return parseInt(el.css('margin-' + side), 10); -} - -// Dialog Tests -module("dialog"); - -test("init", function() { - expect(7); - - $("<div></div>").appendTo('body').dialog().remove(); - ok(true, '.dialog() called on element'); - - $([]).dialog().remove(); - ok(true, '.dialog() called on empty collection'); - - $('<div></div>').dialog().remove(); - ok(true, '.dialog() called on disconnected DOMElement - never connected'); - - $('<div></div>').appendTo('body').remove().dialog().remove(); - ok(true, '.dialog() called on disconnected DOMElement - removed'); - - $('<div></div>').dialog().dialog("foo").remove(); - ok(true, 'arbitrary method called after init'); - - el = $('<div></div>').dialog(); - var foo = el.data("foo.dialog"); - el.remove(); - ok(true, 'arbitrary option getter after init'); - - $('<div></div>').dialog().data("foo.dialog", "bar").remove(); - ok(true, 'arbitrary option setter after init'); -}); - -test("destroy", function() { - expect(6); - - $("<div></div>").appendTo('body').dialog().dialog("destroy").remove(); - ok(true, '.dialog("destroy") called on element'); - - $([]).dialog().dialog("destroy").remove(); - ok(true, '.dialog("destroy") called on empty collection'); - - $('<div></div>').dialog().dialog("destroy").remove(); - ok(true, '.dialog("destroy") called on disconnected DOMElement'); - - $('<div></div>').dialog().dialog("destroy").dialog("foo").remove(); - ok(true, 'arbitrary method called after destroy'); - - el = $('<div></div>').dialog(); - var foo = el.dialog("destroy").data("foo.dialog"); - el.remove(); - ok(true, 'arbitrary option getter after destroy'); - - $('<div></div>').dialog().dialog("destroy").data("foo.dialog", "bar").remove(); - ok(true, 'arbitrary option setter after destroy'); -}); - -/* -//This one takes a while to run - -test("element types", function() { - var typeNames = ('p,h1,h2,h3,h4,h5,h6,blockquote,ol,ul,dl,div,form' - + ',table,fieldset,address,ins,del,em,strong,q,cite,dfn,abbr' - + ',acronym,code,samp,kbd,var,img,object,hr' - + ',input,button,label,select,iframe').split(','); - - $.each(typeNames, function(i) { - var typeName = typeNames[i]; - el = $(document.createElement(typeName)).appendTo('body'); - (typeName == 'table' && el.append("<tr><td>content</td></tr>")); - el.dialog(); - ok(true, '$("<' + typeName + '/>").dialog()'); - el.dialog("destroy"); - el.remove(); - }); -}); - -*/ - -test("defaults", function() { - el = $('<div></div>').dialog(); - $.each(defaults, function(key, val) { - var actual = el.data(key + ".dialog"), expected = val; - same(actual, expected, key); - }); - el.remove(); -}); - -test("title id", function() { - expect(3); - - var titleId; - - // reset the uuid so we know what values to expect - $.ui.dialog.uuid = 0; - - el = $('<div></div>').dialog(); - titleId = dlg().find('.ui-dialog-title').attr('id'); - equals(titleId, 'ui-dialog-title-1', 'auto-numbered title id'); - el.remove(); - - el = $('<div></div>').dialog(); - titleId = dlg().find('.ui-dialog-title').attr('id'); - equals(titleId, 'ui-dialog-title-2', 'auto-numbered title id'); - el.remove(); - - el = $('<div id="foo"/>').dialog(); - titleId = dlg().find('.ui-dialog-title').attr('id'); - equals(titleId, 'ui-dialog-title-foo', 'carried over title id'); - el.remove(); -}); - -test("ARIA", function() { - expect(4); - - el = $('<div></div>').dialog(); - - equals(dlg().attr('role'), 'dialog', 'dialog role'); - - var labelledBy = dlg().attr('aria-labelledby'); - ok(labelledBy.length > 0, 'has aria-labelledby attribute'); - equals(dlg().find('.ui-dialog-title').attr('id'), labelledBy, - 'proper aria-labelledby attribute'); - - equals(dlg().find('.ui-dialog-titlebar-close').attr('role'), 'button', - 'close link role'); - - el.remove(); -}); - -module("dialog: Options"); - -test("autoOpen", function() { - expect(2); - - el = $('<div></div>').dialog({ autoOpen: false }); - isNotOpen('.dialog({ autoOpen: false })'); - el.remove(); - - el = $('<div></div>').dialog({ autoOpen: true }); - isOpen('.dialog({ autoOpen: true })'); - el.remove(); -}); - -test("buttons", function() { - expect(17); - - var buttons = { - "Ok": function(ev, ui) { - ok(true, "button click fires callback"); - equals(this, el[0], "context of callback"); - equals(ev.target, btn[0], "event target"); - }, - "Cancel": function(ev, ui) { - ok(true, "button click fires callback"); - equals(this, el[0], "context of callback"); - equals(ev.target, btn[1], "event target"); - } - }; - - el = $('<div></div>').dialog({ buttons: buttons }); - var btn = $("button", dlg()); - equals(btn.length, 2, "number of buttons"); - - var i = 0; - $.each(buttons, function(key, val) { - equals(btn.eq(i).text(), key, "text of button " + (i+1)); - i++; - }); - - ok(btn.parent().hasClass('ui-dialog-buttonpane'), "buttons in container"); - btn.trigger("click"); - - var newButtons = { - "Close": function(ev, ui) { - ok(true, "button click fires callback"); - equals(this, el[0], "context of callback"); - equals(ev.target, btn[0], "event target"); - } - }; - - equals(el.data("buttons.dialog"), buttons, '.data("buttons.dialog") getter'); - el.data("buttons.dialog", newButtons); - equals(el.data("buttons.dialog"), newButtons, '.data("buttons.dialog", ...) setter'); - - btn = $("button", dlg()); - equals(btn.length, 1, "number of buttons after setter"); - btn.trigger('click'); - - i = 0; - $.each(newButtons, function(key, val) { - equals(btn.eq(i).text(), key, "text of button " + (i+1)); - i += 1; - }); - - el.remove(); -}); - -test("closeOnEscape", function() { - ok(false, 'missing test'); -}); - -test("closeText", function() { - expect(3); - - el = $('<div></div>').dialog(); - equals(dlg().find('.ui-dialog-titlebar-close span').text(), 'close', - 'default close text'); - el.remove(); - - el = $('<div></div>').dialog({ closeText: "foo" }); - equals(dlg().find('.ui-dialog-titlebar-close span').text(), 'foo', - 'closeText on init'); - el.remove(); - - el = $('<div></div>').dialog().dialog('option', 'closeText', 'bar'); - equals(dlg().find('.ui-dialog-titlebar-close span').text(), 'bar', - 'closeText via option method'); - el.remove(); -}); - -test("dialogClass", function() { - expect(4); - - el = $('<div></div>').dialog(); - equals(dlg().is(".foo"), false, 'dialogClass not specified. foo class added'); - el.remove(); - - el = $('<div></div>').dialog({ dialogClass: "foo" }); - equals(dlg().is(".foo"), true, 'dialogClass in init. foo class added'); - el.remove(); - - el = $('<div></div>').dialog({ dialogClass: "foo bar" }); - equals(dlg().is(".foo"), true, 'dialogClass in init, two classes. foo class added'); - equals(dlg().is(".bar"), true, 'dialogClass in init, two classes. bar class added'); - el.remove(); -}); - -test("draggable", function() { - expect(4); - - el = $('<div></div>').dialog({ draggable: false }); - shouldnotmove(); - el.data('draggable.dialog', true); - shouldmove(); - el.remove(); - - el = $('<div></div>').dialog({ draggable: true }); - shouldmove(); - el.data('draggable.dialog', false); - shouldnotmove(); - el.remove(); -}); - -test("height", function() { - expect(3); - - el = $('<div></div>').dialog(); - equals(dlg().height(), defaults.minHeight, "default height"); - el.remove(); - - el = $('<div></div>').dialog({ height: 437 }); - equals(dlg().height(), 437, "explicit height"); - el.remove(); - - el = $('<div></div>').dialog(); - el.data('height.dialog', 438); - equals(dlg().height(), 438, "explicit height set after init"); - el.remove(); -}); - -test("maxHeight", function() { - expect(3); - - el = $('<div></div>').dialog({ maxHeight: 400 }); - drag('.ui-resizable-s', 1000, 1000); - equals(heightAfter, 400, "maxHeight"); - el.remove(); - - el = $('<div></div>').dialog({ maxHeight: 400 }); - drag('.ui-resizable-n', -1000, -1000); - equals(heightAfter, 400, "maxHeight"); - el.remove(); - - el = $('<div></div>').dialog({ maxHeight: 400 }).data('maxHeight.dialog', 600); - drag('.ui-resizable-n', -1000, -1000); - equals(heightAfter, 600, "maxHeight"); - el.remove(); -}); - -test("maxWidth", function() { - expect(3); - - el = $('<div></div>').dialog({ maxWidth: 400 }); - drag('.ui-resizable-e', 1000, 1000); - equals(widthAfter, 400, "maxWidth"); - el.remove(); - - el = $('<div></div>').dialog({ maxWidth: 400 }); - drag('.ui-resizable-w', -1000, -1000); - equals(widthAfter, 400, "maxWidth"); - el.remove(); - - el = $('<div></div>').dialog({ maxWidth: 400 }).data('maxWidth.dialog', 600); - drag('.ui-resizable-w', -1000, -1000); - equals(widthAfter, 600, "maxWidth"); - el.remove(); -}); - -test("minHeight", function() { - expect(3); - - el = $('<div></div>').dialog({ minHeight: 10 }); - drag('.ui-resizable-s', -1000, -1000); - equals(heightAfter, 10, "minHeight"); - el.remove(); - - el = $('<div></div>').dialog({ minHeight: 10 }); - drag('.ui-resizable-n', 1000, 1000); - equals(heightAfter, 10, "minHeight"); - el.remove(); - - el = $('<div></div>').dialog({ minHeight: 10 }).data('minHeight.dialog', 30); - drag('.ui-resizable-n', 1000, 1000); - equals(heightAfter, 30, "minHeight"); - el.remove(); -}); - -test("minWidth", function() { - expect(3); - - el = $('<div></div>').dialog({ minWidth: 10 }); - drag('.ui-resizable-e', -1000, -1000); - equals(widthAfter, 10, "minWidth"); - el.remove(); - - el = $('<div></div>').dialog({ minWidth: 10 }); - drag('.ui-resizable-w', 1000, 1000); - equals(widthAfter, 10, "minWidth"); - el.remove(); - - el = $('<div></div>').dialog({ minWidth: 30 }).data('minWidth.dialog', 30); - drag('.ui-resizable-w', 1000, 1000); - equals(widthAfter, 30, "minWidth"); - el.remove(); -}); - -test("modal", function() { - ok(false, "missing test"); -}); - -test("overlay", function() { - ok(false, "missing test"); -}); - -test("position", function() { - ok(false, "missing test"); -}); - -test("resizable", function() { - expect(4); - - el = $('<div></div>').dialog(); - shouldresize("[default]"); - el.data('resizable.dialog', false); - shouldnotresize('disabled after init'); - el.remove(); - - el = $('<div></div>').dialog({ resizable: false }); - shouldnotresize("disabled in init options"); - el.data('resizable.dialog', true); - shouldresize('enabled after init'); - el.remove(); -}); - -test("stack", function() { - ok(false, "missing test"); -}); - -test("title", function() { - expect(5); - - function titleText() { - return dlg().find(".ui-dialog-title").html(); - } - - el = $('<div></div>').dialog(); - equals(titleText(), " ", "[default]"); - el.remove(); - - el = $('<div title="foo"/>').dialog(); - equals(titleText(), "foo", "title in element attribute"); - el.remove(); - - el = $('<div></div>').dialog({ title: 'foo' }); - equals(titleText(), "foo", "title in init options"); - el.remove(); - - el = $('<div title="foo"/>').dialog({ title: 'bar' }); - equals(titleText(), "bar", "title in init options should override title in element attribute"); - el.remove(); - - el = $('<div></div>').dialog().data('title.dialog', 'foo'); - equals(titleText(), 'foo', 'title after init'); - el.remove(); -}); - -test("width", function() { - expect(3); - - el = $('<div></div>').dialog(); - equals(dlg().width(), defaults.width, "default width"); - el.remove(); - - el = $('<div></div>').dialog({width: 437 }); - equals(dlg().width(), 437, "explicit width"); - el.data('width.dialog', 438); - equals(dlg().width(), 438, 'explicit width after init'); - el.remove(); -}); - -module("dialog: Methods"); - -test("isOpen", function() { - expect(4); - - el = $('<div></div>').dialog(); - equals(el.dialog('isOpen'), true, "dialog is open after init"); - el.dialog('close'); - equals(el.dialog('isOpen'), false, "dialog is closed"); - el.remove(); - - el = $('<div></div>').dialog({autoOpen: false}); - equals(el.dialog('isOpen'), false, "dialog is closed after init"); - el.dialog('open'); - equals(el.dialog('isOpen'), true, "dialog is open"); - el.remove(); -}); - -module("dialog: Callbacks"); - -test("open", function() { - expect(6); - - el = $("<div></div>"); - el.dialog({ - open: function(ev, ui) { - ok(true, 'autoOpen: true fires open callback'); - equals(this, el[0], "context of callback"); - } - }); - el.remove(); - - el = $("<div></div>"); - el.dialog({ - autoOpen: false, - open: function(ev, ui) { - ok(true, '.dialog("open") fires open callback'); - equals(this, el[0], "context of callback"); - } - }); - el.dialog("open"); - el.remove(); - - el = $('<div></div>').dialog({ - autoOpen: false - }); - el.bind('dialogopen', function(ev, ui) { - ok(true, 'dialog("open") fires open event'); - equals(this, el[0], 'context of event'); - }); - el.dialog('open'); - el.remove(); -}); - -test("dragStart", function() { - expect(2); - - el = $("<div></div>"); - el.dialog({ - dragStart: function(ev, ui) { - ok(true, 'dragging fires dragStart callback'); - equals(this, el[0], "context of callback"); - } - }); - var handle = $(".ui-dialog-titlebar", dlg()); - drag(handle, 50, 50); - el.remove(); -}); - -test("drag", function() { - var fired = false; - - el = $("<div></div>"); - el.dialog({ - drag: function(ev, ui) { - fired = true; - equals(this, el[0], "context of callback"); - } - }); - var handle = $(".ui-dialog-titlebar", dlg()); - drag(handle, 50, 50); - ok(fired, "drag fired"); - el.remove(); -}); - -test("dragStop", function() { - expect(2); - - el = $("<div></div>"); - el.dialog({ - dragStop: function(ev, ui) { - ok(true, 'dragging fires dragStop callback'); - equals(this, el[0], "context of callback"); - } - }); - var handle = $(".ui-dialog-titlebar", dlg()); - drag(handle, 50, 50); - el.remove(); -}); - -test("resizeStart", function() { - expect(2); - - el = $("<div></div>"); - el.dialog({ - resizeStart: function(ev, ui) { - ok(true, 'resizing fires resizeStart callback'); - equals(this, el[0], "context of callback"); - } - }); - var handle = $(".ui-resizable-se", dlg()); - drag(handle, 50, 50); - el.remove(); -}); - -test("resize", function() { - var fired = false; - - el = $("<div></div>"); - el.dialog({ - resize: function(ev, ui) { - fired = true; - equals(this, el[0], "context of callback"); - } - }); - var handle = $(".ui-resizable-se", dlg()); - drag(handle, 50, 50); - ok(fired, "resize fired"); - el.remove(); -}); - -test("resizeStop", function() { - expect(2); - - el = $("<div></div>"); - el.dialog({ - resizeStop: function(ev, ui) { - ok(true, 'resizing fires resizeStop callback'); - equals(this, el[0], "context of callback"); - } - }); - var handle = $(".ui-resizable-se", dlg()); - drag(handle, 50, 50); - el.remove(); -}); - -test("close", function() { - expect(4); - - el = $('<div></div>').dialog({ - close: function(ev, ui) { - ok(true, '.dialog("close") fires close callback'); - equals(this, el[0], "context of callback"); - } - }); - el.dialog("close"); - el.remove(); - - el = $('<div></div>').dialog().bind('dialogclose', function(ev, ui) { - ok(true, '.dialog("close") fires dialogclose event'); - equals(this, el[0], 'context of event'); - }); - el.dialog('close'); - el.remove(); -}); - -test("beforeclose", function() { - expect(6); - - el = $('<div></div>').dialog({ - beforeclose: function(ev, ui) { - ok(true, '.dialog("close") fires beforeclose callback'); - equals(this, el[0], "context of callback"); - return false; - } - }); - el.dialog('close'); - isOpen('beforeclose callback should prevent dialog from closing'); - el.remove(); - - el = $('<div></div>').dialog().bind('dialogbeforeclose', function(ev, ui) { - ok(true, '.dialog("close") triggers dialogbeforeclose event'); - equals(this, el[0], "context of event"); - return false; - }); - el.dialog('close'); - isOpen('dialogbeforeclose event should prevent dialog from closing'); - el.remove(); -}); - -module("dialog: Tickets"); - -})(jQuery); +/*
+ * dialog unit tests
+ */
+(function($) {
+//
+// Dialog Test Helper Functions
+//
+
+var defaults = {
+ autoOpen: true,
+ buttons: {},
+ closeOnEscape: true,
+ closeText: 'close',
+ disabled: false,
+ dialogClass: undefined,
+ draggable: true,
+ height: 'auto',
+ maxHeight: undefined,
+ maxWidth: undefined,
+ minHeight: 150,
+ minWidth: 150,
+ modal: false,
+ overlay: {},
+ position: 'center',
+ resizable: true,
+ stack: true,
+ title: '',
+ width: 300
+};
+
+var el,
+ offsetBefore, offsetAfter,
+ heightBefore, heightAfter,
+ widthBefore, widthAfter,
+ dragged;
+
+function dlg() {
+ return el.data("dialog").element.parents(".ui-dialog:first");
+}
+
+function isOpen(why) {
+ ok(dlg().is(":visible"), why);
+}
+
+function isNotOpen(why) {
+ ok(!dlg().is(":visible"), why);
+}
+
+function drag(handle, dx, dy) {
+ var d = dlg();
+ offsetBefore = d.offset();
+ heightBefore = d.height();
+ widthBefore = d.width();
+ //this mouseover is to work around a limitation in resizable
+ //TODO: fix resizable so handle doesn't require mouseover in order to be used
+ $(handle, d).simulate("mouseover");
+ $(handle, d).simulate("drag", {
+ dx: dx || 0,
+ dy: dy || 0
+ });
+ dragged = { dx: dx, dy: dy };
+ offsetAfter = d.offset();
+ heightAfter = d.height();
+ widthAfter = d.width();
+}
+
+function moved(dx, dy, msg) {
+ msg = msg ? msg + "." : "";
+ var actual = { left: offsetAfter.left, top: offsetAfter.top };
+ var expected = { left: offsetBefore.left + dx, top: offsetBefore.top + dy };
+ same(actual, expected, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ' + msg);
+}
+
+function shouldmove(why) {
+ var handle = $(".ui-dialog-titlebar", dlg());
+ drag(handle, 50, 50);
+ moved(50, 50, why);
+}
+
+function shouldnotmove(why) {
+ var handle = $(".ui-dialog-titlebar", dlg());
+ drag(handle, 50, 50);
+ moved(0, 0, why);
+}
+
+function resized(dw, dh, msg) {
+ msg = msg ? msg + "." : "";
+ var actual = { width: widthAfter, height: heightAfter };
+ var expected = { width: widthBefore + dw, height: heightBefore + dh };
+ same(actual, expected, 'resized[' + dragged.dx + ', ' + dragged.dy + '] ' + msg);
+}
+
+function shouldresize(why) {
+ var handle = $(".ui-resizable-se", dlg());
+ drag(handle, 50, 50);
+ resized(50, 50, why);
+}
+
+function shouldnotresize(why) {
+ var handle = $(".ui-resizable-se", dlg());
+ drag(handle, 50, 50);
+ resized(0, 0, why);
+}
+
+function broder(el, side){
+ return parseInt(el.css('border-' + side + '-width'), 10);
+}
+
+function margin(el, side) {
+ return parseInt(el.css('margin-' + side), 10);
+}
+
+// Dialog Tests
+module("dialog");
+
+test("init", function() {
+ expect(7);
+
+ $("<div></div>").appendTo('body').dialog().remove();
+ ok(true, '.dialog() called on element');
+
+ $([]).dialog().remove();
+ ok(true, '.dialog() called on empty collection');
+
+ $('<div></div>').dialog().remove();
+ ok(true, '.dialog() called on disconnected DOMElement - never connected');
+
+ $('<div></div>').appendTo('body').remove().dialog().remove();
+ ok(true, '.dialog() called on disconnected DOMElement - removed');
+
+ $('<div></div>').dialog().dialog("foo").remove();
+ ok(true, 'arbitrary method called after init');
+
+ el = $('<div></div>').dialog();
+ var foo = el.data("foo.dialog");
+ el.remove();
+ ok(true, 'arbitrary option getter after init');
+
+ $('<div></div>').dialog().data("foo.dialog", "bar").remove();
+ ok(true, 'arbitrary option setter after init');
+});
+
+test("destroy", function() {
+ expect(6);
+
+ $("<div></div>").appendTo('body').dialog().dialog("destroy").remove();
+ ok(true, '.dialog("destroy") called on element');
+
+ $([]).dialog().dialog("destroy").remove();
+ ok(true, '.dialog("destroy") called on empty collection');
+
+ $('<div></div>').dialog().dialog("destroy").remove();
+ ok(true, '.dialog("destroy") called on disconnected DOMElement');
+
+ $('<div></div>').dialog().dialog("destroy").dialog("foo").remove();
+ ok(true, 'arbitrary method called after destroy');
+
+ el = $('<div></div>').dialog();
+ var foo = el.dialog("destroy").data("foo.dialog");
+ el.remove();
+ ok(true, 'arbitrary option getter after destroy');
+
+ $('<div></div>').dialog().dialog("destroy").data("foo.dialog", "bar").remove();
+ ok(true, 'arbitrary option setter after destroy');
+});
+
+/*
+//This one takes a while to run
+
+test("element types", function() {
+ var typeNames = ('p,h1,h2,h3,h4,h5,h6,blockquote,ol,ul,dl,div,form'
+ + ',table,fieldset,address,ins,del,em,strong,q,cite,dfn,abbr'
+ + ',acronym,code,samp,kbd,var,img,object,hr'
+ + ',input,button,label,select,iframe').split(',');
+
+ $.each(typeNames, function(i) {
+ var typeName = typeNames[i];
+ el = $(document.createElement(typeName)).appendTo('body');
+ (typeName == 'table' && el.append("<tr><td>content</td></tr>"));
+ el.dialog();
+ ok(true, '$("<' + typeName + '/>").dialog()');
+ el.dialog("destroy");
+ el.remove();
+ });
+});
+
+*/
+
+test("defaults", function() {
+ el = $('<div></div>').dialog();
+ $.each(defaults, function(key, val) {
+ var actual = el.data(key + ".dialog"), expected = val;
+ same(actual, expected, key);
+ });
+ el.remove();
+});
+
+test("title id", function() {
+ expect(3);
+
+ var titleId;
+
+ // reset the uuid so we know what values to expect
+ $.ui.dialog.uuid = 0;
+
+ el = $('<div></div>').dialog();
+ titleId = dlg().find('.ui-dialog-title').attr('id');
+ equals(titleId, 'ui-dialog-title-1', 'auto-numbered title id');
+ el.remove();
+
+ el = $('<div></div>').dialog();
+ titleId = dlg().find('.ui-dialog-title').attr('id');
+ equals(titleId, 'ui-dialog-title-2', 'auto-numbered title id');
+ el.remove();
+
+ el = $('<div id="foo"/>').dialog();
+ titleId = dlg().find('.ui-dialog-title').attr('id');
+ equals(titleId, 'ui-dialog-title-foo', 'carried over title id');
+ el.remove();
+});
+
+test("ARIA", function() {
+ expect(4);
+
+ el = $('<div></div>').dialog();
+
+ equals(dlg().attr('role'), 'dialog', 'dialog role');
+
+ var labelledBy = dlg().attr('aria-labelledby');
+ ok(labelledBy.length > 0, 'has aria-labelledby attribute');
+ equals(dlg().find('.ui-dialog-title').attr('id'), labelledBy,
+ 'proper aria-labelledby attribute');
+
+ equals(dlg().find('.ui-dialog-titlebar-close').attr('role'), 'button',
+ 'close link role');
+
+ el.remove();
+});
+
+module("dialog: Options");
+
+test("autoOpen", function() {
+ expect(2);
+
+ el = $('<div></div>').dialog({ autoOpen: false });
+ isNotOpen('.dialog({ autoOpen: false })');
+ el.remove();
+
+ el = $('<div></div>').dialog({ autoOpen: true });
+ isOpen('.dialog({ autoOpen: true })');
+ el.remove();
+});
+
+test("buttons", function() {
+ expect(17);
+
+ var buttons = {
+ "Ok": function(ev, ui) {
+ ok(true, "button click fires callback");
+ equals(this, el[0], "context of callback");
+ equals(ev.target, btn[0], "event target");
+ },
+ "Cancel": function(ev, ui) {
+ ok(true, "button click fires callback");
+ equals(this, el[0], "context of callback");
+ equals(ev.target, btn[1], "event target");
+ }
+ };
+
+ el = $('<div></div>').dialog({ buttons: buttons });
+ var btn = $("button", dlg());
+ equals(btn.length, 2, "number of buttons");
+
+ var i = 0;
+ $.each(buttons, function(key, val) {
+ equals(btn.eq(i).text(), key, "text of button " + (i+1));
+ i++;
+ });
+
+ ok(btn.parent().hasClass('ui-dialog-buttonpane'), "buttons in container");
+ btn.trigger("click");
+
+ var newButtons = {
+ "Close": function(ev, ui) {
+ ok(true, "button click fires callback");
+ equals(this, el[0], "context of callback");
+ equals(ev.target, btn[0], "event target");
+ }
+ };
+
+ equals(el.data("buttons.dialog"), buttons, '.data("buttons.dialog") getter');
+ el.data("buttons.dialog", newButtons);
+ equals(el.data("buttons.dialog"), newButtons, '.data("buttons.dialog", ...) setter');
+
+ btn = $("button", dlg());
+ equals(btn.length, 1, "number of buttons after setter");
+ btn.trigger('click');
+
+ i = 0;
+ $.each(newButtons, function(key, val) {
+ equals(btn.eq(i).text(), key, "text of button " + (i+1));
+ i += 1;
+ });
+
+ el.remove();
+});
+
+test("closeOnEscape", function() {
+ ok(false, 'missing test');
+});
+
+test("closeText", function() {
+ expect(3);
+
+ el = $('<div></div>').dialog();
+ equals(dlg().find('.ui-dialog-titlebar-close span').text(), 'close',
+ 'default close text');
+ el.remove();
+
+ el = $('<div></div>').dialog({ closeText: "foo" });
+ equals(dlg().find('.ui-dialog-titlebar-close span').text(), 'foo',
+ 'closeText on init');
+ el.remove();
+
+ el = $('<div></div>').dialog().dialog('option', 'closeText', 'bar');
+ equals(dlg().find('.ui-dialog-titlebar-close span').text(), 'bar',
+ 'closeText via option method');
+ el.remove();
+});
+
+test("dialogClass", function() {
+ expect(4);
+
+ el = $('<div></div>').dialog();
+ equals(dlg().is(".foo"), false, 'dialogClass not specified. foo class added');
+ el.remove();
+
+ el = $('<div></div>').dialog({ dialogClass: "foo" });
+ equals(dlg().is(".foo"), true, 'dialogClass in init. foo class added');
+ el.remove();
+
+ el = $('<div></div>').dialog({ dialogClass: "foo bar" });
+ equals(dlg().is(".foo"), true, 'dialogClass in init, two classes. foo class added');
+ equals(dlg().is(".bar"), true, 'dialogClass in init, two classes. bar class added');
+ el.remove();
+});
+
+test("draggable", function() {
+ expect(4);
+
+ el = $('<div></div>').dialog({ draggable: false });
+ shouldnotmove();
+ el.data('draggable.dialog', true);
+ shouldmove();
+ el.remove();
+
+ el = $('<div></div>').dialog({ draggable: true });
+ shouldmove();
+ el.data('draggable.dialog', false);
+ shouldnotmove();
+ el.remove();
+});
+
+test("height", function() {
+ expect(3);
+
+ el = $('<div></div>').dialog();
+ equals(dlg().height(), defaults.minHeight, "default height");
+ el.remove();
+
+ el = $('<div></div>').dialog({ height: 437 });
+ equals(dlg().height(), 437, "explicit height");
+ el.remove();
+
+ el = $('<div></div>').dialog();
+ el.data('height.dialog', 438);
+ equals(dlg().height(), 438, "explicit height set after init");
+ el.remove();
+});
+
+test("maxHeight", function() {
+ expect(3);
+
+ el = $('<div></div>').dialog({ maxHeight: 400 });
+ drag('.ui-resizable-s', 1000, 1000);
+ equals(heightAfter, 400, "maxHeight");
+ el.remove();
+
+ el = $('<div></div>').dialog({ maxHeight: 400 });
+ drag('.ui-resizable-n', -1000, -1000);
+ equals(heightAfter, 400, "maxHeight");
+ el.remove();
+
+ el = $('<div></div>').dialog({ maxHeight: 400 }).data('maxHeight.dialog', 600);
+ drag('.ui-resizable-n', -1000, -1000);
+ equals(heightAfter, 600, "maxHeight");
+ el.remove();
+});
+
+test("maxWidth", function() {
+ expect(3);
+
+ el = $('<div></div>').dialog({ maxWidth: 400 });
+ drag('.ui-resizable-e', 1000, 1000);
+ equals(widthAfter, 400, "maxWidth");
+ el.remove();
+
+ el = $('<div></div>').dialog({ maxWidth: 400 });
+ drag('.ui-resizable-w', -1000, -1000);
+ equals(widthAfter, 400, "maxWidth");
+ el.remove();
+
+ el = $('<div></div>').dialog({ maxWidth: 400 }).data('maxWidth.dialog', 600);
+ drag('.ui-resizable-w', -1000, -1000);
+ equals(widthAfter, 600, "maxWidth");
+ el.remove();
+});
+
+test("minHeight", function() {
+ expect(3);
+
+ el = $('<div></div>').dialog({ minHeight: 10 });
+ drag('.ui-resizable-s', -1000, -1000);
+ equals(heightAfter, 10, "minHeight");
+ el.remove();
+
+ el = $('<div></div>').dialog({ minHeight: 10 });
+ drag('.ui-resizable-n', 1000, 1000);
+ equals(heightAfter, 10, "minHeight");
+ el.remove();
+
+ el = $('<div></div>').dialog({ minHeight: 10 }).data('minHeight.dialog', 30);
+ drag('.ui-resizable-n', 1000, 1000);
+ equals(heightAfter, 30, "minHeight");
+ el.remove();
+});
+
+test("minWidth", function() {
+ expect(3);
+
+ el = $('<div></div>').dialog({ minWidth: 10 });
+ drag('.ui-resizable-e', -1000, -1000);
+ equals(widthAfter, 10, "minWidth");
+ el.remove();
+
+ el = $('<div></div>').dialog({ minWidth: 10 });
+ drag('.ui-resizable-w', 1000, 1000);
+ equals(widthAfter, 10, "minWidth");
+ el.remove();
+
+ el = $('<div></div>').dialog({ minWidth: 30 }).data('minWidth.dialog', 30);
+ drag('.ui-resizable-w', 1000, 1000);
+ equals(widthAfter, 30, "minWidth");
+ el.remove();
+});
+
+test("modal", function() {
+ ok(false, "missing test");
+});
+
+test("overlay", function() {
+ ok(false, "missing test");
+});
+
+test("position", function() {
+ ok(false, "missing test");
+});
+
+test("resizable", function() {
+ expect(4);
+
+ el = $('<div></div>').dialog();
+ shouldresize("[default]");
+ el.data('resizable.dialog', false);
+ shouldnotresize('disabled after init');
+ el.remove();
+
+ el = $('<div></div>').dialog({ resizable: false });
+ shouldnotresize("disabled in init options");
+ el.data('resizable.dialog', true);
+ shouldresize('enabled after init');
+ el.remove();
+});
+
+test("stack", function() {
+ ok(false, "missing test");
+});
+
+test("title", function() {
+ expect(5);
+
+ function titleText() {
+ return dlg().find(".ui-dialog-title").html();
+ }
+
+ el = $('<div></div>').dialog();
+ equals(titleText(), " ", "[default]");
+ el.remove();
+
+ el = $('<div title="foo"/>').dialog();
+ equals(titleText(), "foo", "title in element attribute");
+ el.remove();
+
+ el = $('<div></div>').dialog({ title: 'foo' });
+ equals(titleText(), "foo", "title in init options");
+ el.remove();
+
+ el = $('<div title="foo"/>').dialog({ title: 'bar' });
+ equals(titleText(), "bar", "title in init options should override title in element attribute");
+ el.remove();
+
+ el = $('<div></div>').dialog().data('title.dialog', 'foo');
+ equals(titleText(), 'foo', 'title after init');
+ el.remove();
+});
+
+test("width", function() {
+ expect(3);
+
+ el = $('<div></div>').dialog();
+ equals(dlg().width(), defaults.width, "default width");
+ el.remove();
+
+ el = $('<div></div>').dialog({width: 437 });
+ equals(dlg().width(), 437, "explicit width");
+ el.data('width.dialog', 438);
+ equals(dlg().width(), 438, 'explicit width after init');
+ el.remove();
+});
+
+module("dialog: Methods");
+
+test("isOpen", function() {
+ expect(4);
+
+ el = $('<div></div>').dialog();
+ equals(el.dialog('isOpen'), true, "dialog is open after init");
+ el.dialog('close');
+ equals(el.dialog('isOpen'), false, "dialog is closed");
+ el.remove();
+
+ el = $('<div></div>').dialog({autoOpen: false});
+ equals(el.dialog('isOpen'), false, "dialog is closed after init");
+ el.dialog('open');
+ equals(el.dialog('isOpen'), true, "dialog is open");
+ el.remove();
+});
+
+module("dialog: Callbacks");
+
+test("open", function() {
+ expect(6);
+
+ el = $("<div></div>");
+ el.dialog({
+ open: function(ev, ui) {
+ ok(true, 'autoOpen: true fires open callback');
+ equals(this, el[0], "context of callback");
+ }
+ });
+ el.remove();
+
+ el = $("<div></div>");
+ el.dialog({
+ autoOpen: false,
+ open: function(ev, ui) {
+ ok(true, '.dialog("open") fires open callback');
+ equals(this, el[0], "context of callback");
+ }
+ });
+ el.dialog("open");
+ el.remove();
+
+ el = $('<div></div>').dialog({
+ autoOpen: false
+ });
+ el.bind('dialogopen', function(ev, ui) {
+ ok(true, 'dialog("open") fires open event');
+ equals(this, el[0], 'context of event');
+ });
+ el.dialog('open');
+ el.remove();
+});
+
+test("dragStart", function() {
+ expect(2);
+
+ el = $("<div></div>");
+ el.dialog({
+ dragStart: function(ev, ui) {
+ ok(true, 'dragging fires dragStart callback');
+ equals(this, el[0], "context of callback");
+ }
+ });
+ var handle = $(".ui-dialog-titlebar", dlg());
+ drag(handle, 50, 50);
+ el.remove();
+});
+
+test("drag", function() {
+ var fired = false;
+
+ el = $("<div></div>");
+ el.dialog({
+ drag: function(ev, ui) {
+ fired = true;
+ equals(this, el[0], "context of callback");
+ }
+ });
+ var handle = $(".ui-dialog-titlebar", dlg());
+ drag(handle, 50, 50);
+ ok(fired, "drag fired");
+ el.remove();
+});
+
+test("dragStop", function() {
+ expect(2);
+
+ el = $("<div></div>");
+ el.dialog({
+ dragStop: function(ev, ui) {
+ ok(true, 'dragging fires dragStop callback');
+ equals(this, el[0], "context of callback");
+ }
+ });
+ var handle = $(".ui-dialog-titlebar", dlg());
+ drag(handle, 50, 50);
+ el.remove();
+});
+
+test("resizeStart", function() {
+ expect(2);
+
+ el = $("<div></div>");
+ el.dialog({
+ resizeStart: function(ev, ui) {
+ ok(true, 'resizing fires resizeStart callback');
+ equals(this, el[0], "context of callback");
+ }
+ });
+ var handle = $(".ui-resizable-se", dlg());
+ drag(handle, 50, 50);
+ el.remove();
+});
+
+test("resize", function() {
+ var fired = false;
+
+ el = $("<div></div>");
+ el.dialog({
+ resize: function(ev, ui) {
+ fired = true;
+ equals(this, el[0], "context of callback");
+ }
+ });
+ var handle = $(".ui-resizable-se", dlg());
+ drag(handle, 50, 50);
+ ok(fired, "resize fired");
+ el.remove();
+});
+
+test("resizeStop", function() {
+ expect(2);
+
+ el = $("<div></div>");
+ el.dialog({
+ resizeStop: function(ev, ui) {
+ ok(true, 'resizing fires resizeStop callback');
+ equals(this, el[0], "context of callback");
+ }
+ });
+ var handle = $(".ui-resizable-se", dlg());
+ drag(handle, 50, 50);
+ el.remove();
+});
+
+test("close", function() {
+ expect(4);
+
+ el = $('<div></div>').dialog({
+ close: function(ev, ui) {
+ ok(true, '.dialog("close") fires close callback');
+ equals(this, el[0], "context of callback");
+ }
+ });
+ el.dialog("close");
+ el.remove();
+
+ el = $('<div></div>').dialog().bind('dialogclose', function(ev, ui) {
+ ok(true, '.dialog("close") fires dialogclose event');
+ equals(this, el[0], 'context of event');
+ });
+ el.dialog('close');
+ el.remove();
+});
+
+test("beforeclose", function() {
+ expect(6);
+
+ el = $('<div></div>').dialog({
+ beforeclose: function(ev, ui) {
+ ok(true, '.dialog("close") fires beforeclose callback');
+ equals(this, el[0], "context of callback");
+ return false;
+ }
+ });
+ el.dialog('close');
+ isOpen('beforeclose callback should prevent dialog from closing');
+ el.remove();
+
+ el = $('<div></div>').dialog().bind('dialogbeforeclose', function(ev, ui) {
+ ok(true, '.dialog("close") triggers dialogbeforeclose event');
+ equals(this, el[0], "context of event");
+ return false;
+ });
+ el.dialog('close');
+ isOpen('dialogbeforeclose event should prevent dialog from closing');
+ el.remove();
+});
+
+module("dialog: Tickets");
+
+})(jQuery);
diff --git a/tests/draggable.html b/tests/unit/draggable/draggable.html index 9cb817619..2d129c9d6 100644 --- a/tests/draggable.html +++ b/tests/unit/draggable/draggable.html @@ -3,14 +3,14 @@ <head> <title>jQuery UI Draggable Test Suite</title> - <script type="text/javascript" src="../jquery-1.3pre.js"></script> - <script type="text/javascript" src="../ui/ui.core.js"></script> - <script type="text/javascript" src="../ui/ui.draggable.js"></script> + <script type="text/javascript" src="../../../jquery-1.3pre.js"></script> + <script type="text/javascript" src="../../../ui/ui.core.js"></script> + <script type="text/javascript" src="../../../ui/ui.draggable.js"></script> - <link type="text/css" href="testsuite.css" rel="stylesheet" /> - <script type="text/javascript" src="testsuite.js"></script> - <script type="text/javascript" src="qunit/testrunner.js"></script> - <script type="text/javascript" src="simulate/jquery.simulate.js"></script> + <link type="text/css" href="../testsuite.css" rel="stylesheet" /> + <script type="text/javascript" src="../testsuite.js"></script> + <script type="text/javascript" src="../../../external/qunit/testrunner.js"></script> + <script type="text/javascript" src="../../../external/simulate/jquery.simulate.js"></script> <script type="text/javascript" src="draggable.js"></script> </head> diff --git a/tests/draggable.js b/tests/unit/draggable/draggable.js index d5ef7fda9..d5ef7fda9 100644 --- a/tests/draggable.js +++ b/tests/unit/draggable/draggable.js diff --git a/tests/unit/droppable/droppable.html b/tests/unit/droppable/droppable.html new file mode 100644 index 000000000..3881adf1d --- /dev/null +++ b/tests/unit/droppable/droppable.html @@ -0,0 +1,27 @@ +<!doctype html> +<html lang="en"> +<head> + <title>jQuery UI Droppable Test Suite</title> + + <script type="text/javascript" src="../../../jquery-1.3pre.js"></script> + <script type="text/javascript" src="../../../ui/ui.core.js"></script> + <script type="text/javascript" src="../../../ui/ui.draggable.js"></script> + <script type="text/javascript" src="../../../ui/ui.droppable.js"></script> + + <link type="text/css" href="../testsuite.css" rel="stylesheet" /> + <script type="text/javascript" src="../testsuite.js"></script> + <script type="text/javascript" src="../../../external/qunit/testrunner.js"></script> + <script type="text/javascript" src="../../../external/simulate/jquery.simulate.js"></script> + + <script type="text/javascript" src="droppable.js"></script> +</head> +<body> + +<div id="main"> + <div id="draggable1" style="width: 25px; height: 25px;">Draggable</div> + <div id="droppable1" style="width: 100px; height: 100px;">Droppable</div> + <div style='width:1000px;height:1000px;'> </div> +</div> + +</body> +</html> diff --git a/tests/droppable.js b/tests/unit/droppable/droppable.js index 31915defc..31915defc 100644 --- a/tests/droppable.js +++ b/tests/unit/droppable/droppable.js diff --git a/tests/unit/progressbar/progressbar.html b/tests/unit/progressbar/progressbar.html new file mode 100644 index 000000000..c6d9becfb --- /dev/null +++ b/tests/unit/progressbar/progressbar.html @@ -0,0 +1,24 @@ +<!doctype html> +<html lang="en"> +<head> + <title>jQuery UI Progressbar Test Suite</title> + + <script type="text/javascript" src="../../../jquery-1.3pre.js"></script> + <script type="text/javascript" src="../../../ui/ui.core.js"></script> + <script type="text/javascript" src="../../../ui/ui.progressbar.js"></script> + + <link type="text/css" href="../testsuite.css" rel="stylesheet" /> + <script type="text/javascript" src="../testsuite.js"></script> + <script type="text/javascript" src="../../../external/qunit/testrunner.js"></script> + <script type="text/javascript" src="../../../external/simulate/jquery.simulate.js"></script> + + <script type="text/javascript" src="progressbar.js"></script> +</head> +<body> + +<div id="main"> + <div id="progressbar"></div> +</div> + +</body> +</html> diff --git a/tests/progressbar.js b/tests/unit/progressbar/progressbar.js index 087106510..087106510 100644 --- a/tests/progressbar.js +++ b/tests/unit/progressbar/progressbar.js diff --git a/tests/images/test.jpg b/tests/unit/resizable/images/test.jpg Binary files differindex 7d8ec0996..7d8ec0996 100644 --- a/tests/images/test.jpg +++ b/tests/unit/resizable/images/test.jpg diff --git a/tests/unit/resizable/resizable.html b/tests/unit/resizable/resizable.html new file mode 100644 index 000000000..5d2889884 --- /dev/null +++ b/tests/unit/resizable/resizable.html @@ -0,0 +1,25 @@ +<!doctype html> +<html lang="en"> +<head> + <title>jQuery UI Resizable Test Suite</title> + + <script type="text/javascript" src="../../../jquery-1.3pre.js"></script> + <script type="text/javascript" src="../../../ui/ui.core.js"></script> + <script type="text/javascript" src="../../../ui/ui.resizable.js"></script> + + <link type="text/css" href="../testsuite.css" rel="stylesheet" /> + <script type="text/javascript" src="../testsuite.js"></script> + <script type="text/javascript" src="../../../external/qunit/testrunner.js"></script> + <script type="text/javascript" src="../../../external/simulate/jquery.simulate.js"></script> + + <script type="text/javascript" src="resizable.js"></script> +</head> +<body> + +<div id="main"> + <div id="resizable1" style="background: green; width: 100px; height: 100px;">I'm a resizable.</div> + <img src="images/test.jpg" id="resizable2" style="width: 100px; height: 100px;"/> +</div> + +</body> +</html> diff --git a/tests/resizable.js b/tests/unit/resizable/resizable.js index 98a69de5b..98a69de5b 100644 --- a/tests/resizable.js +++ b/tests/unit/resizable/resizable.js diff --git a/tests/unit/selectable/selectable.html b/tests/unit/selectable/selectable.html new file mode 100644 index 000000000..e35d28ad1 --- /dev/null +++ b/tests/unit/selectable/selectable.html @@ -0,0 +1,30 @@ +<!doctype html> +<html lang="en"> +<head> + <title>jQuery UI Selectable Test Suite</title> + + <script type="text/javascript" src="../../../jquery-1.3pre.js"></script> + <script type="text/javascript" src="../../../ui/ui.core.js"></script> + <script type="text/javascript" src="../../../ui/ui.selectable.js"></script> + + <link type="text/css" href="../testsuite.css" rel="stylesheet" /> + <script type="text/javascript" src="../testsuite.js"></script> + <script type="text/javascript" src="../../../external/qunit/testrunner.js"></script> + <script type="text/javascript" src="../../../external/simulate/jquery.simulate.js"></script> + + <script type="text/javascript" src="selectable.js"></script> +</head> +<body> + +<div id="main"> + <ul id="selectable1"> + <li>Item 1</li> + <li>Item 2</li> + <li class="special">Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + </ul> +</div> + +</body> +</html> diff --git a/tests/selectable.js b/tests/unit/selectable/selectable.js index df23626ca..df23626ca 100644 --- a/tests/selectable.js +++ b/tests/unit/selectable/selectable.js diff --git a/tests/unit/slider/slider.html b/tests/unit/slider/slider.html new file mode 100644 index 000000000..c4a30168a --- /dev/null +++ b/tests/unit/slider/slider.html @@ -0,0 +1,27 @@ +<!doctype html> +<html lang="en"> +<head> + <title>jQuery UI Slider Test Suite</title> + + <script type="text/javascript" src="../../../jquery-1.3pre.js"></script> + <script type="text/javascript" src="../../../ui/ui.core.js"></script> + <script type="text/javascript" src="../../../ui/ui.slider.js"></script> + + <link type="text/css" href="../testsuite.css" rel="stylesheet" /> + <script type="text/javascript" src="../testsuite.js"></script> + <script type="text/javascript" src="../../../external/qunit/testrunner.js"></script> + <script type="text/javascript" src="../../../external/simulate/jquery.simulate.js"></script> + + <script type="text/javascript" src="slider.js"></script> +</head> +<body> + +<div id="main"> + <div id="slider1"></div> + <div id="slider3" style="position: relative; margin: 40px; width: 217px; height: 28px;"> + <div class="ui-slider-handle" style="position: absolute; height: 21px; left: 0px; bottom: 0px; width: 17px;"></div> + </div> +</div> + +</body> +</html> diff --git a/tests/slider.js b/tests/unit/slider/slider.js index 34d29b4fd..34d29b4fd 100644 --- a/tests/slider.js +++ b/tests/unit/slider/slider.js diff --git a/tests/unit/sortable/sortable.html b/tests/unit/sortable/sortable.html new file mode 100644 index 000000000..5c45144bc --- /dev/null +++ b/tests/unit/sortable/sortable.html @@ -0,0 +1,30 @@ +<!doctype html> +<html lang="en"> +<head> + <title>jQuery UI Sortable Test Suite</title> + + <script type="text/javascript" src="../../../jquery-1.3pre.js"></script> + <script type="text/javascript" src="../../../ui/ui.core.js"></script> + <script type="text/javascript" src="../../../ui/ui.sortable.js"></script> + + <link type="text/css" href="../testsuite.css" rel="stylesheet" /> + <script type="text/javascript" src="../testsuite.js"></script> + <script type="text/javascript" src="../../../external/qunit/testrunner.js"></script> + <script type="text/javascript" src="../../../external/simulate/jquery.simulate.js"></script> + + <script type="text/javascript" src="sortable.js"></script> +</head> +<body> + +<div id="main"> + <ul id="sortable"> + <li>Item 1</li> + <li>Item 2</li> + <li>Item 3</li> + <li>Item 4</li> + <li>Item 5</li> + </ul> +</div> + +</body> +</html> diff --git a/tests/sortable.js b/tests/unit/sortable/sortable.js index c913ed86d..c913ed86d 100644 --- a/tests/sortable.js +++ b/tests/unit/sortable/sortable.js diff --git a/tests/tabs.html b/tests/unit/tabs/tabs.html index eb0224212..57ddb6680 100644 --- a/tests/tabs.html +++ b/tests/unit/tabs/tabs.html @@ -3,16 +3,15 @@ <head> <title>jQuery UI Tabs Test Suite</title> - <script type="text/javascript" src="../jquery-1.3pre.js"></script> - <script type="text/javascript" src="../ui/ui.core.js"></script> - <script type="text/javascript" src="../ui/ui.tabs.js"></script> - - <link type="text/css" href="testsuite.css" rel="stylesheet" /> - <script type="text/javascript" src="testsuite.js"></script> - <script type="text/javascript" src="qunit/testrunner.js"></script> - <script type="text/javascript" src="simulate/jquery.simulate.js"></script> - - <script type="text/javascript" src="plugins/cookie/jquery.cookie.js"></script> + <script type="text/javascript" src="../../../jquery-1.3pre.js"></script> + <script type="text/javascript" src="../../../ui/ui.core.js"></script> + <script type="text/javascript" src="../../../ui/ui.tabs.js"></script> + + <link type="text/css" href="../testsuite.css" rel="stylesheet" /> + <script type="text/javascript" src="../testsuite.js"></script> + <script type="text/javascript" src="../../../external/qunit/testrunner.js"></script> + <script type="text/javascript" src="../../../external/simulate/jquery.simulate.js"></script> + <script type="text/javascript" src="../../../external/cookie/jquery.cookie.js"></script> <script type="text/javascript" src="tabs.js"></script> </head> diff --git a/tests/tabs.js b/tests/unit/tabs/tabs.js index 41d59f060..41d59f060 100644 --- a/tests/tabs.js +++ b/tests/unit/tabs/tabs.js diff --git a/tests/testsuite.css b/tests/unit/testsuite.css index b278cc6d9..f1961ff47 100644 --- a/tests/testsuite.css +++ b/tests/unit/testsuite.css @@ -1,4 +1,4 @@ -@import url("qunit/testsuite.css"); +@import url("../../external/qunit/testsuite.css"); html { border: 0; } .xerror, .error, .ui-tabs-hide { display: none } #main { position: absolute; top: -10000px; left: -10000px; } diff --git a/tests/testsuite.js b/tests/unit/testsuite.js index 2ad60cbab..2ad60cbab 100644 --- a/tests/testsuite.js +++ b/tests/unit/testsuite.js |