diff options
Diffstat (limited to 'tests/unit')
30 files changed, 107 insertions, 49 deletions
diff --git a/tests/unit/accordion/accordion_options.js b/tests/unit/accordion/accordion_options.js index 2b8222f5c..5d950e1ac 100644 --- a/tests/unit/accordion/accordion_options.js +++ b/tests/unit/accordion/accordion_options.js @@ -105,9 +105,9 @@ asyncTest( "{ animate: Number }", function() { panels = element.find( ".ui-accordion-content" ), animate = $.fn.animate; // called twice (both panels) - $.fn.animate = function( props, duration, easing ) { - equal( duration, 100, "correct duration" ); - equal( easing, undefined, "default easing" ); + $.fn.animate = function( props, options ) { + equal( options.duration, 100, "correct duration" ); + equal( options.easing, undefined, "default easing" ); animate.apply( this, arguments ); }; @@ -129,9 +129,9 @@ asyncTest( "{ animate: String }", function() { panels = element.find( ".ui-accordion-content" ), animate = $.fn.animate; // called twice (both panels) - $.fn.animate = function( props, duration, easing ) { - equal( duration, undefined, "default duration" ); - equal( easing, "linear", "correct easing" ); + $.fn.animate = function( props, options ) { + equal( options.duration, undefined, "default duration" ); + equal( options.easing, "linear", "correct easing" ); animate.apply( this, arguments ); }; @@ -153,9 +153,9 @@ asyncTest( "{ animate: {} }", function() { panels = element.find( ".ui-accordion-content" ), animate = $.fn.animate; // called twice (both panels) - $.fn.animate = function( props, duration, easing ) { - equal( duration, undefined, "default duration" ); - equal( easing, undefined, "default easing" ); + $.fn.animate = function( props, options ) { + equal( options.duration, undefined, "default duration" ); + equal( options.easing, undefined, "default easing" ); animate.apply( this, arguments ); }; @@ -177,9 +177,9 @@ asyncTest( "{ animate: { duration, easing } }", function() { panels = element.find( ".ui-accordion-content" ), animate = $.fn.animate; // called twice (both panels) - $.fn.animate = function( props, duration, easing ) { - equal( duration, 100, "correct duration" ); - equal( easing, "linear", "correct easing" ); + $.fn.animate = function( props, options ) { + equal( options.duration, 100, "correct duration" ); + equal( options.easing, "linear", "correct easing" ); animate.apply( this, arguments ); }; @@ -202,9 +202,9 @@ asyncTest( "{ animate: { duration, easing } }, animate down", function() { panels = element.find( ".ui-accordion-content" ), animate = $.fn.animate; // called twice (both panels) - $.fn.animate = function( props, duration, easing ) { - equal( duration, 100, "correct duration" ); - equal( easing, "linear", "correct easing" ); + $.fn.animate = function( props, options ) { + equal( options.duration, 100, "correct duration" ); + equal( options.easing, "linear", "correct easing" ); animate.apply( this, arguments ); }; @@ -233,9 +233,9 @@ asyncTest( "{ animate: { duration, easing, down } }, animate down", function() { panels = element.find( ".ui-accordion-content" ), animate = $.fn.animate; // called twice (both panels) - $.fn.animate = function( props, duration, easing ) { - equal( duration, 100, "correct duration" ); - equal( easing, "swing", "correct easing" ); + $.fn.animate = function( props, options ) { + equal( options.duration, 100, "correct duration" ); + equal( options.easing, "swing", "correct easing" ); animate.apply( this, arguments ); }; diff --git a/tests/unit/accordion/all.html b/tests/unit/accordion/all.html index a40ec47ed..8e7948b7b 100644 --- a/tests/unit/accordion/all.html +++ b/tests/unit/accordion/all.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>jQuery UI Accordion Test Suite</title> - <script src="../../../jquery-1.8.0.js"></script> + <script src="../../../jquery-1.8.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> <link rel="stylesheet" href="../qunit-composite.css"> diff --git a/tests/unit/all-active.html b/tests/unit/all-active.html index 5095e354c..36719acdf 100644 --- a/tests/unit/all-active.html +++ b/tests/unit/all-active.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>jQuery UI Test Suite</title> - <script src="../../jquery-1.8.0.js"></script> + <script src="../../jquery-1.8.2.js"></script> <link rel="stylesheet" href="../../external/qunit.css"> <link rel="stylesheet" href="qunit-composite.css"> diff --git a/tests/unit/all.html b/tests/unit/all.html index 80da77e50..c1b5d0383 100644 --- a/tests/unit/all.html +++ b/tests/unit/all.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>jQuery UI Test Suite</title> - <script src="../../jquery-1.8.0.js"></script> + <script src="../../jquery-1.8.2.js"></script> <link rel="stylesheet" href="../../external/qunit.css"> <link rel="stylesheet" href="qunit-composite.css"> diff --git a/tests/unit/autocomplete/all.html b/tests/unit/autocomplete/all.html index 3fa793b85..c8eb3bf18 100644 --- a/tests/unit/autocomplete/all.html +++ b/tests/unit/autocomplete/all.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>jQuery UI Autocomplete Test Suite</title> - <script src="../../../jquery-1.8.0.js"></script> + <script src="../../../jquery-1.8.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> <link rel="stylesheet" href="../qunit-composite.css"> diff --git a/tests/unit/button/all.html b/tests/unit/button/all.html index 21d11fce2..04aaeb0c5 100644 --- a/tests/unit/button/all.html +++ b/tests/unit/button/all.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>jQuery UI Button Test Suite</title> - <script src="../../../jquery-1.8.0.js"></script> + <script src="../../../jquery-1.8.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> <link rel="stylesheet" href="../qunit-composite.css"> diff --git a/tests/unit/core/all.html b/tests/unit/core/all.html index eafa22f05..cedd2c1d1 100644 --- a/tests/unit/core/all.html +++ b/tests/unit/core/all.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>jQuery UI Core Test Suite</title> - <script src="../../../jquery-1.8.0.js"></script> + <script src="../../../jquery-1.8.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> <link rel="stylesheet" href="../qunit-composite.css"> diff --git a/tests/unit/datepicker/all.html b/tests/unit/datepicker/all.html index 153704c04..85a272149 100644 --- a/tests/unit/datepicker/all.html +++ b/tests/unit/datepicker/all.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>jQuery UI Datepicker Test Suite</title> - <script src="../../../jquery-1.8.0.js"></script> + <script src="../../../jquery-1.8.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> <link rel="stylesheet" href="../qunit-composite.css"> diff --git a/tests/unit/dialog/all.html b/tests/unit/dialog/all.html index bf563ebe6..b4f5660cb 100644 --- a/tests/unit/dialog/all.html +++ b/tests/unit/dialog/all.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>jQuery UI Dialog Test Suite</title> - <script src="../../../jquery-1.8.0.js"></script> + <script src="../../../jquery-1.8.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> <link rel="stylesheet" href="../qunit-composite.css"> diff --git a/tests/unit/draggable/all.html b/tests/unit/draggable/all.html index dc0ad95ee..c05d729c1 100644 --- a/tests/unit/draggable/all.html +++ b/tests/unit/draggable/all.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>jQuery UI Draggable Test Suite</title> - <script src="../../../jquery-1.8.0.js"></script> + <script src="../../../jquery-1.8.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> <link rel="stylesheet" href="../qunit-composite.css"> diff --git a/tests/unit/droppable/all.html b/tests/unit/droppable/all.html index a8e3a945e..0f41d1f1d 100644 --- a/tests/unit/droppable/all.html +++ b/tests/unit/droppable/all.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>jQuery UI Droppable Test Suite</title> - <script src="../../../jquery-1.8.0.js"></script> + <script src="../../../jquery-1.8.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> <link rel="stylesheet" href="../qunit-composite.css"> diff --git a/tests/unit/effects/all.html b/tests/unit/effects/all.html index e7d41dd13..b59e44ed6 100644 --- a/tests/unit/effects/all.html +++ b/tests/unit/effects/all.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>jQuery UI Effects Test Suite</title> - <script src="../../../jquery-1.8.0.js"></script> + <script src="../../../jquery-1.8.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> <link rel="stylesheet" href="../qunit-composite.css"> diff --git a/tests/unit/index.html b/tests/unit/index.html index 6979ef83b..c12d5acb9 100644 --- a/tests/unit/index.html +++ b/tests/unit/index.html @@ -7,7 +7,7 @@ <link rel="stylesheet" href="../../themes/base/jquery.ui.core.css"> <link rel="stylesheet" href="../../themes/base/jquery.ui.theme.css"> <link rel="stylesheet" href="../index.css"> - <script src="../jquery-1.8.0.js"></script> + <script src="../jquery-1.8.2.js"></script> <script src="../index.js"></script> </head> <body> diff --git a/tests/unit/menu/all.html b/tests/unit/menu/all.html index 7025efce6..b7a388833 100644 --- a/tests/unit/menu/all.html +++ b/tests/unit/menu/all.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>jQuery UI Menu Test Suite</title> - <script src="../../../jquery-1.8.0.js"></script> + <script src="../../../jquery-1.8.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> <link rel="stylesheet" href="../qunit-composite.css"> diff --git a/tests/unit/menu/menu_events.js b/tests/unit/menu/menu_events.js index 69ae2e14f..d69fc46a3 100644 --- a/tests/unit/menu/menu_events.js +++ b/tests/unit/menu/menu_events.js @@ -57,13 +57,15 @@ asyncTest( "handle blur", function() { }); click( element, "1" ); - setTimeout( function() { + setTimeout(function() { element.blur(); - start(); - }, 350 ); + setTimeout(function() { + start(); + }, 350 ); + }); }); -asyncTest( "handle blur on click", function() { +asyncTest( "handle blur via click outside", function() { expect( 1 ); var blurHandled = false, element = $( "#menu1" ).menu({ @@ -77,10 +79,12 @@ asyncTest( "handle blur on click", function() { }); click( element, "1" ); - setTimeout( function() { + setTimeout(function() { $( "<a>", { id: "remove"} ).appendTo( "body" ).trigger( "click" ); - start(); - }, 350 ); + setTimeout(function() { + start(); + }, 350 ); + }); }); test( "handle focus of menu with active item", function() { diff --git a/tests/unit/position/all.html b/tests/unit/position/all.html index 138c0cd89..38e041172 100644 --- a/tests/unit/position/all.html +++ b/tests/unit/position/all.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>jQuery UI Position Test Suite</title> - <script src="../../../jquery-1.8.0.js"></script> + <script src="../../../jquery-1.8.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> <link rel="stylesheet" href="../qunit-composite.css"> diff --git a/tests/unit/progressbar/all.html b/tests/unit/progressbar/all.html index ca611b068..a88193dc9 100644 --- a/tests/unit/progressbar/all.html +++ b/tests/unit/progressbar/all.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>jQuery UI Progressbar Test Suite</title> - <script src="../../../jquery-1.8.0.js"></script> + <script src="../../../jquery-1.8.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> <link rel="stylesheet" href="../qunit-composite.css"> diff --git a/tests/unit/resizable/all.html b/tests/unit/resizable/all.html index d349d1e68..b1b5c239e 100644 --- a/tests/unit/resizable/all.html +++ b/tests/unit/resizable/all.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>jQuery UI Resizable Test Suite</title> - <script src="../../../jquery-1.8.0.js"></script> + <script src="../../../jquery-1.8.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> <link rel="stylesheet" href="../qunit-composite.css"> diff --git a/tests/unit/selectable/all.html b/tests/unit/selectable/all.html index e6cef3117..be404b7dc 100644 --- a/tests/unit/selectable/all.html +++ b/tests/unit/selectable/all.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>jQuery UI Selectable Test Suite</title> - <script src="../../../jquery-1.8.0.js"></script> + <script src="../../../jquery-1.8.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> <link rel="stylesheet" href="../qunit-composite.css"> diff --git a/tests/unit/slider/all.html b/tests/unit/slider/all.html index 34f0e22f0..1ba3386a0 100644 --- a/tests/unit/slider/all.html +++ b/tests/unit/slider/all.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>jQuery UI Slider Test Suite</title> - <script src="../../../jquery-1.8.0.js"></script> + <script src="../../../jquery-1.8.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> <link rel="stylesheet" href="../qunit-composite.css"> diff --git a/tests/unit/sortable/all.html b/tests/unit/sortable/all.html index ee7841a43..003ed0ed3 100644 --- a/tests/unit/sortable/all.html +++ b/tests/unit/sortable/all.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>jQuery UI Sortable Test Suite</title> - <script src="../../../jquery-1.8.0.js"></script> + <script src="../../../jquery-1.8.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> <link rel="stylesheet" href="../qunit-composite.css"> diff --git a/tests/unit/spinner/all.html b/tests/unit/spinner/all.html index 4c91b08d6..c81de0a09 100644 --- a/tests/unit/spinner/all.html +++ b/tests/unit/spinner/all.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>jQuery UI Spinner Test Suite</title> - <script src="../../../jquery-1.8.0.js"></script> + <script src="../../../jquery-1.8.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> <link rel="stylesheet" href="../qunit-composite.css"> diff --git a/tests/unit/subsuite.js b/tests/unit/subsuite.js index 67781f1dc..1a16a9e94 100644 --- a/tests/unit/subsuite.js +++ b/tests/unit/subsuite.js @@ -3,7 +3,7 @@ var versions = [ "1.6", "1.6.1", "1.6.2", "1.6.3", "1.6.4", "1.7", "1.7.1", "1.7.2", - "1.8.0", + "1.8.0", "1.8.1", "1.8.2", "git" ], additionalTests = { diff --git a/tests/unit/tabs/all.html b/tests/unit/tabs/all.html index e5299c4eb..4ba90d02f 100644 --- a/tests/unit/tabs/all.html +++ b/tests/unit/tabs/all.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>jQuery UI Tabs Test Suite</title> - <script src="../../../jquery-1.8.0.js"></script> + <script src="../../../jquery-1.8.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> <link rel="stylesheet" href="../qunit-composite.css"> diff --git a/tests/unit/tabs/tabs.html b/tests/unit/tabs/tabs.html index 3a55f3b79..e6c954727 100644 --- a/tests/unit/tabs/tabs.html +++ b/tests/unit/tabs/tabs.html @@ -145,6 +145,14 @@ </div> </div> +<div id="tabs9"> + <ul> + <li>not a tab</li> + <li><a href="#tabs9-1">tab</a></li> + </ul> + <div id="tabs9-1"></div> +</div> + </div> </body> </html> diff --git a/tests/unit/tabs/tabs_core.js b/tests/unit/tabs/tabs_core.js index 53dd50a98..5dbe1d6b1 100644 --- a/tests/unit/tabs/tabs_core.js +++ b/tests/unit/tabs/tabs_core.js @@ -44,6 +44,15 @@ test( "disconnected from DOM", function() { equal( element.find( ".ui-tabs-panel" ).length, 3, "should initialize panels" ); }); +test( "non-tab list items", function() { + expect( 2 ); + + var element = $( "#tabs9" ).tabs(); + equal( element.tabs( "option", "active" ), 0, "defaults to first tab" ); + equal( element.find( ".ui-tabs-nav li.ui-state-active" ).index(), 1, + "first actual tab is active" ); +}); + test( "aria-controls", function() { expect( 7 ); var element = $( "#tabs1" ).tabs(), diff --git a/tests/unit/tabs/tabs_deprecated.html b/tests/unit/tabs/tabs_deprecated.html index bb4088350..9d3ecef3a 100644 --- a/tests/unit/tabs/tabs_deprecated.html +++ b/tests/unit/tabs/tabs_deprecated.html @@ -144,6 +144,14 @@ </div> </div> +<div id="tabs9"> + <ul> + <li>not a tab</li> + <li><a href="#tabs9-1">tab</a></li> + </ul> + <div id="tabs9-1"></div> +</div> + </div> </body> </html> diff --git a/tests/unit/tooltip/all.html b/tests/unit/tooltip/all.html index 367eb4584..6329326b9 100644 --- a/tests/unit/tooltip/all.html +++ b/tests/unit/tooltip/all.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>jQuery UI Tooltip Test Suite</title> - <script src="../../../jquery-1.8.0.js"></script> + <script src="../../../jquery-1.8.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> <link rel="stylesheet" href="../qunit-composite.css"> diff --git a/tests/unit/tooltip/tooltip_options.js b/tests/unit/tooltip/tooltip_options.js index 771da6da7..db193e8fa 100644 --- a/tests/unit/tooltip/tooltip_options.js +++ b/tests/unit/tooltip/tooltip_options.js @@ -46,6 +46,35 @@ asyncTest( "content: sync + async callback", function() { }).tooltip( "open" ); }); +test( "content: change while open", function() { + expect( 2 ) ; + var element = $( "#tooltipped1" ).tooltip({ + content: function() { + return "old"; + } + }); + + element.one( "tooltipopen", function( event, ui ) { + equal( ui.tooltip.text(), "old", "original content" ); + element.tooltip( "option", "content", function() { + return "new"; + }); + equal( ui.tooltip.text(), "new", "updated content" ); + }); + + element.tooltip( "open" ); +}); + +test( "content: string", function() { + expect( 1 ); + var element = $( "#tooltipped1" ).tooltip({ + content: "just a string", + open: function( event, ui ) { + equal( ui.tooltip.text(), "just a string" ); + } + }).tooltip( "open" ); +}); + test( "items", function() { expect( 2 ); var event, diff --git a/tests/unit/widget/all.html b/tests/unit/widget/all.html index 77fd80de1..b02a43cc9 100644 --- a/tests/unit/widget/all.html +++ b/tests/unit/widget/all.html @@ -4,7 +4,7 @@ <meta charset="utf-8"> <title>jQuery UI Widget Test Suite</title> - <script src="../../../jquery-1.8.0.js"></script> + <script src="../../../jquery-1.8.2.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> <link rel="stylesheet" href="../qunit-composite.css"> |