From 1e6b2b22984cc0d708d704028b85321528948b50 Mon Sep 17 00:00:00 2001 From: Scott González Date: Mon, 13 Aug 2012 09:19:09 -0400 Subject: Upgrade jQuery to 1.8.0. --- tests/unit/accordion/all.html | 2 +- tests/unit/all-active.html | 2 +- tests/unit/all.html | 2 +- tests/unit/autocomplete/all.html | 2 +- tests/unit/button/all.html | 2 +- tests/unit/core/all.html | 2 +- tests/unit/datepicker/all.html | 2 +- tests/unit/dialog/all.html | 2 +- tests/unit/draggable/all.html | 2 +- tests/unit/droppable/all.html | 2 +- tests/unit/effects/all.html | 2 +- tests/unit/index.html | 2 +- tests/unit/menu/all.html | 2 +- tests/unit/position/all.html | 2 +- tests/unit/progressbar/all.html | 2 +- tests/unit/resizable/all.html | 2 +- tests/unit/selectable/all.html | 2 +- tests/unit/slider/all.html | 2 +- tests/unit/sortable/all.html | 2 +- tests/unit/spinner/all.html | 2 +- tests/unit/subsuite.js | 7 ++++++- tests/unit/tabs/all.html | 2 +- tests/unit/tooltip/all.html | 2 +- tests/unit/widget/all.html | 2 +- 24 files changed, 29 insertions(+), 24 deletions(-) (limited to 'tests/unit') diff --git a/tests/unit/accordion/all.html b/tests/unit/accordion/all.html index 2fb783c1c..a40ec47ed 100644 --- a/tests/unit/accordion/all.html +++ b/tests/unit/accordion/all.html @@ -4,7 +4,7 @@ jQuery UI Accordion Test Suite - + diff --git a/tests/unit/all-active.html b/tests/unit/all-active.html index b3e2fbcba..5095e354c 100644 --- a/tests/unit/all-active.html +++ b/tests/unit/all-active.html @@ -4,7 +4,7 @@ jQuery UI Test Suite - + diff --git a/tests/unit/all.html b/tests/unit/all.html index 6d98df0f9..80da77e50 100644 --- a/tests/unit/all.html +++ b/tests/unit/all.html @@ -4,7 +4,7 @@ jQuery UI Test Suite - + diff --git a/tests/unit/autocomplete/all.html b/tests/unit/autocomplete/all.html index e35777f65..3fa793b85 100644 --- a/tests/unit/autocomplete/all.html +++ b/tests/unit/autocomplete/all.html @@ -4,7 +4,7 @@ jQuery UI Autocomplete Test Suite - + diff --git a/tests/unit/button/all.html b/tests/unit/button/all.html index 6c46c9650..21d11fce2 100644 --- a/tests/unit/button/all.html +++ b/tests/unit/button/all.html @@ -4,7 +4,7 @@ jQuery UI Button Test Suite - + diff --git a/tests/unit/core/all.html b/tests/unit/core/all.html index e31d6905c..eafa22f05 100644 --- a/tests/unit/core/all.html +++ b/tests/unit/core/all.html @@ -4,7 +4,7 @@ jQuery UI Core Test Suite - + diff --git a/tests/unit/datepicker/all.html b/tests/unit/datepicker/all.html index c62c7c07d..153704c04 100644 --- a/tests/unit/datepicker/all.html +++ b/tests/unit/datepicker/all.html @@ -4,7 +4,7 @@ jQuery UI Datepicker Test Suite - + diff --git a/tests/unit/dialog/all.html b/tests/unit/dialog/all.html index b1c69c6c9..bf563ebe6 100644 --- a/tests/unit/dialog/all.html +++ b/tests/unit/dialog/all.html @@ -4,7 +4,7 @@ jQuery UI Dialog Test Suite - + diff --git a/tests/unit/draggable/all.html b/tests/unit/draggable/all.html index 75df351ad..dc0ad95ee 100644 --- a/tests/unit/draggable/all.html +++ b/tests/unit/draggable/all.html @@ -4,7 +4,7 @@ jQuery UI Draggable Test Suite - + diff --git a/tests/unit/droppable/all.html b/tests/unit/droppable/all.html index aa24ed7e1..a8e3a945e 100644 --- a/tests/unit/droppable/all.html +++ b/tests/unit/droppable/all.html @@ -4,7 +4,7 @@ jQuery UI Droppable Test Suite - + diff --git a/tests/unit/effects/all.html b/tests/unit/effects/all.html index 59500588c..e7d41dd13 100644 --- a/tests/unit/effects/all.html +++ b/tests/unit/effects/all.html @@ -4,7 +4,7 @@ jQuery UI Effects Test Suite - + diff --git a/tests/unit/index.html b/tests/unit/index.html index 33a326370..6979ef83b 100644 --- a/tests/unit/index.html +++ b/tests/unit/index.html @@ -7,7 +7,7 @@ - + diff --git a/tests/unit/menu/all.html b/tests/unit/menu/all.html index 475c1b717..7025efce6 100644 --- a/tests/unit/menu/all.html +++ b/tests/unit/menu/all.html @@ -4,7 +4,7 @@ jQuery UI Menu Test Suite - + diff --git a/tests/unit/position/all.html b/tests/unit/position/all.html index d76f9bbd8..138c0cd89 100644 --- a/tests/unit/position/all.html +++ b/tests/unit/position/all.html @@ -4,7 +4,7 @@ jQuery UI Position Test Suite - + diff --git a/tests/unit/progressbar/all.html b/tests/unit/progressbar/all.html index 16b9e0ace..ca611b068 100644 --- a/tests/unit/progressbar/all.html +++ b/tests/unit/progressbar/all.html @@ -4,7 +4,7 @@ jQuery UI Progressbar Test Suite - + diff --git a/tests/unit/resizable/all.html b/tests/unit/resizable/all.html index bef29ff6e..d349d1e68 100644 --- a/tests/unit/resizable/all.html +++ b/tests/unit/resizable/all.html @@ -4,7 +4,7 @@ jQuery UI Resizable Test Suite - + diff --git a/tests/unit/selectable/all.html b/tests/unit/selectable/all.html index 51778e771..e6cef3117 100644 --- a/tests/unit/selectable/all.html +++ b/tests/unit/selectable/all.html @@ -4,7 +4,7 @@ jQuery UI Selectable Test Suite - + diff --git a/tests/unit/slider/all.html b/tests/unit/slider/all.html index bfadc0380..34f0e22f0 100644 --- a/tests/unit/slider/all.html +++ b/tests/unit/slider/all.html @@ -4,7 +4,7 @@ jQuery UI Slider Test Suite - + diff --git a/tests/unit/sortable/all.html b/tests/unit/sortable/all.html index f9d63d62e..ee7841a43 100644 --- a/tests/unit/sortable/all.html +++ b/tests/unit/sortable/all.html @@ -4,7 +4,7 @@ jQuery UI Sortable Test Suite - + diff --git a/tests/unit/spinner/all.html b/tests/unit/spinner/all.html index 72a2dd77a..4c91b08d6 100644 --- a/tests/unit/spinner/all.html +++ b/tests/unit/spinner/all.html @@ -4,7 +4,7 @@ jQuery UI Spinner Test Suite - + diff --git a/tests/unit/subsuite.js b/tests/unit/subsuite.js index 6f966590b..67781f1dc 100644 --- a/tests/unit/subsuite.js +++ b/tests/unit/subsuite.js @@ -1,6 +1,11 @@ (function() { -var versions = [ "1.6", "1.6.1", "1.6.2", "1.6.3", "1.6.4", "1.7", "1.7.1", "1.7.2", "git" ], +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", + "git" + ], additionalTests = { accordion: [ "accordion_deprecated.html" ], position: [ "position_deprecated.html" ], diff --git a/tests/unit/tabs/all.html b/tests/unit/tabs/all.html index 41bf965f2..e5299c4eb 100644 --- a/tests/unit/tabs/all.html +++ b/tests/unit/tabs/all.html @@ -4,7 +4,7 @@ jQuery UI Tabs Test Suite - + diff --git a/tests/unit/tooltip/all.html b/tests/unit/tooltip/all.html index c1aa35acf..367eb4584 100644 --- a/tests/unit/tooltip/all.html +++ b/tests/unit/tooltip/all.html @@ -4,7 +4,7 @@ jQuery UI Tooltip Test Suite - + diff --git a/tests/unit/widget/all.html b/tests/unit/widget/all.html index e5b16c8d7..77fd80de1 100644 --- a/tests/unit/widget/all.html +++ b/tests/unit/widget/all.html @@ -4,7 +4,7 @@ jQuery UI Widget Test Suite - + -- cgit v1.2.3 From af67883226954114ef4782f81d1b6360d6516ee9 Mon Sep 17 00:00:00 2001 From: Scott González Date: Fri, 17 Aug 2012 09:08:07 -0400 Subject: Tabs: Set ajaxOptions in intial $.ajax() call. Fixes #8504 - Ajax in Tabs not passing data in 1.9. beta 1. --- tests/unit/tabs/tabs_deprecated.js | 6 ++++- ui/jquery.ui.tabs.js | 51 +++++++++++++++++++++++--------------- 2 files changed, 36 insertions(+), 21 deletions(-) (limited to 'tests/unit') diff --git a/tests/unit/tabs/tabs_deprecated.js b/tests/unit/tabs/tabs_deprecated.js index 351433348..4a938c078 100644 --- a/tests/unit/tabs/tabs_deprecated.js +++ b/tests/unit/tabs/tabs_deprecated.js @@ -25,10 +25,11 @@ test( "panel ids", function() { module( "tabs (deprecated): options" ); asyncTest( "ajaxOptions", function() { - expect( 1 ); + expect( 2 ); var element = $( "#tabs2" ).tabs({ ajaxOptions: { + data: "foo=bar", converters: { "text html": function() { return "test"; @@ -36,6 +37,9 @@ asyncTest( "ajaxOptions", function() { } } }); + element.one( "tabsbeforeload", function( event, ui ) { + equal( ui.ajaxSettings.url.replace( /^[^\?]+/, "" ), "?foo=bar", "ajaxOptions.data" ); + }); element.one( "tabsload", function( event, ui ) { equal( $( ui.panel ).html(), "test" ); start(); diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js index b31ce364a..524f4178e 100644 --- a/ui/jquery.ui.tabs.js +++ b/ui/jquery.ui.tabs.js @@ -792,13 +792,7 @@ $.widget( "ui.tabs", { return; } - this.xhr = $.ajax({ - url: anchor.attr( "href" ), - beforeSend: function( jqXHR, settings ) { - return that._trigger( "beforeLoad", event, - $.extend( { jqXHR : jqXHR, ajaxSettings: settings }, eventData ) ); - } - }); + this.xhr = $.ajax( this._ajaxSettings( anchor, event, eventData ) ); // support: jQuery <1.8 // jQuery <1.8 returns false if the request is canceled in beforeSend, @@ -835,6 +829,18 @@ $.widget( "ui.tabs", { } }, + // TODO: Remove this function in 1.10 when ajaxOptions is removed + _ajaxSettings: function( anchor, event, eventData ) { + var that = this; + return { + url: anchor.attr( "href" ), + beforeSend: function( jqXHR, settings ) { + return that._trigger( "beforeLoad", event, + $.extend( { jqXHR : jqXHR, ajaxSettings: settings }, eventData ) ); + } + }; + }, + _getPanelForTab: function( tab ) { var id = $( tab ).attr( "aria-controls" ); return this.element.find( this._sanitizeSelector( "#" + id ) ); @@ -860,6 +866,7 @@ if ( $.uiBackCompat !== false ) { } }); + // TODO: Remove _ajaxSettings() method when removing this extension // ajaxOptions and cache options $.widget( "ui.tabs", $.ui.tabs, { options: { @@ -879,19 +886,6 @@ if ( $.uiBackCompat !== false ) { return; } - $.extend( ui.ajaxSettings, that.options.ajaxOptions, { - error: function( xhr, s, e ) { - try { - // Passing index avoid a race condition when this method is - // called after the user has selected another tab. - // Pass the anchor that initiated this request allows - // loadError to manipulate the tab content panel via $(a.hash) - that.options.ajaxOptions.error( xhr, s, ui.tab.closest( "li" ).index(), ui.tab[ 0 ] ); - } - catch ( e ) {} - } - }); - ui.jqXHR.success(function() { if ( that.options.cache ) { $.data( ui.tab[ 0 ], "cache.tabs", true ); @@ -900,6 +894,23 @@ if ( $.uiBackCompat !== false ) { }}); }, + _ajaxSettings: function( anchor, event, ui ) { + var ajaxOptions = this.options.ajaxOptions; + return $.extend( {}, ajaxOptions, { + error: function( xhr, s, e ) { + try { + // Passing index avoid a race condition when this method is + // called after the user has selected another tab. + // Pass the anchor that initiated this request allows + // loadError to manipulate the tab content panel via $(a.hash) + ajaxOptions.error( + xhr, s, ui.tab.closest( "li" ).index(), ui.tab[ 0 ] ); + } + catch ( e ) {} + } + }, this._superApply( arguments ) ); + }, + _setOption: function( key, value ) { // reset cache if switching from cached to not cached if ( key === "cache" && value === false ) { -- cgit v1.2.3 From 42b21fd3eddda0adfedbeaa4629735ab0928d69d Mon Sep 17 00:00:00 2001 From: Scott González Date: Sun, 26 Aug 2012 18:37:30 -0400 Subject: Tests: Removed completed TODO. --- tests/unit/testsuite.js | 1 - 1 file changed, 1 deletion(-) (limited to 'tests/unit') diff --git a/tests/unit/testsuite.js b/tests/unit/testsuite.js index 26f46138a..4c6898fb3 100644 --- a/tests/unit/testsuite.js +++ b/tests/unit/testsuite.js @@ -20,7 +20,6 @@ QUnit.config.urlConfig.push({ TestHelpers.loadResources = QUnit.urlParams.min ? function() { - // TODO: proper include with theme images includeStyle( "dist/jquery-ui.min.css" ); includeScript( "dist/jquery-ui.min.js" ); } : -- cgit v1.2.3 From 103463323a0c4108c29ab7b6859d83067aafc4c6 Mon Sep 17 00:00:00 2001 From: Scott González Date: Sun, 26 Aug 2012 20:00:36 -0400 Subject: Accordion tests: Added test for widget() method. --- tests/unit/accordion/accordion_methods.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/unit') diff --git a/tests/unit/accordion/accordion_methods.js b/tests/unit/accordion/accordion_methods.js index 8723bcbb7..f8f556fa7 100644 --- a/tests/unit/accordion/accordion_methods.js +++ b/tests/unit/accordion/accordion_methods.js @@ -45,4 +45,12 @@ test( "refresh", function() { equalHeight( element, 455 ); }); +test( "widget", function() { + expect( 2 ); + var element = $( "#list1" ).accordion(), + widgetElement = element.accordion( "widget" ); + equal( widgetElement.length, 1, "one element" ); + strictEqual( widgetElement[ 0 ], element[ 0 ], "same element" ); +}); + }( jQuery ) ); -- cgit v1.2.3 From 7f6ef7ffad9f8f118f18503dc015d441e47f6d24 Mon Sep 17 00:00:00 2001 From: Scott González Date: Sun, 26 Aug 2012 20:15:03 -0400 Subject: Autocomplete tests: Added test for widget() method. --- tests/unit/autocomplete/autocomplete_methods.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/unit') diff --git a/tests/unit/autocomplete/autocomplete_methods.js b/tests/unit/autocomplete/autocomplete_methods.js index 1600d73dc..1bfa10554 100644 --- a/tests/unit/autocomplete/autocomplete_methods.js +++ b/tests/unit/autocomplete/autocomplete_methods.js @@ -34,4 +34,12 @@ test( "search, close", function() { ok( menu.is( ":hidden" ), "menu is hidden after close" ); }); +test( "widget", function() { + expect( 2 ); + var element = $( "#autocomplete" ).autocomplete(), + widgetElement = element.autocomplete( "widget" ); + equal( widgetElement.length, 1, "one element" ); + ok( widgetElement.is( ".ui-menu" ), "menu element" ); +}); + }( jQuery ) ); -- cgit v1.2.3 From 355a1a6f0a47334585f917dbfa6382ba965e39cd Mon Sep 17 00:00:00 2001 From: Scott González Date: Sun, 26 Aug 2012 20:16:30 -0400 Subject: Menu tests: re-order tests. --- tests/unit/menu/menu_methods.js | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'tests/unit') diff --git a/tests/unit/menu/menu_methods.js b/tests/unit/menu/menu_methods.js index 510ddb1d7..bfe974b06 100644 --- a/tests/unit/menu/menu_methods.js +++ b/tests/unit/menu/menu_methods.js @@ -10,6 +10,22 @@ module( "menu: methods", { } }); +test( "destroy", function() { + expect( 4 ); + domEqual( "#menu1", function() { + $( "#menu1" ).menu().menu( "destroy" ); + }); + domEqual( "#menu2", function() { + $( "#menu2" ).menu().menu( "destroy" ); + }); + domEqual( "#menu5", function() { + $( "#menu5").menu().menu( "destroy" ); + }); + domEqual( "#menu6", function() { + $( "#menu6" ).menu().menu( "destroy" ); + }); +}); + test( "enable/disable", function() { expect( 3 ); var element = $( "#menu1" ).menu({ @@ -68,20 +84,4 @@ test( "refresh", function() { // TODO: test select method -test( "destroy", function() { - expect( 4 ); - domEqual( "#menu1", function() { - $( "#menu1" ).menu().menu( "destroy" ); - }); - domEqual( "#menu2", function() { - $( "#menu2" ).menu().menu( "destroy" ); - }); - domEqual( "#menu5", function() { - $( "#menu5").menu().menu( "destroy" ); - }); - domEqual( "#menu6", function() { - $( "#menu6" ).menu().menu( "destroy" ); - }); -}); - })( jQuery ); -- cgit v1.2.3 From 2e491e0bb747da7dd1d465e78cc46e9c98237051 Mon Sep 17 00:00:00 2001 From: Scott González Date: Sun, 26 Aug 2012 20:17:36 -0400 Subject: Menu tests: Added test for widget() method. --- tests/unit/menu/menu_methods.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/unit') diff --git a/tests/unit/menu/menu_methods.js b/tests/unit/menu/menu_methods.js index bfe974b06..f9241f27b 100644 --- a/tests/unit/menu/menu_methods.js +++ b/tests/unit/menu/menu_methods.js @@ -60,6 +60,14 @@ test( "refresh", function() { equal( element.find( ".ui-menu-item" ).length, 5, "Incorrect number of menu items" ); }); +test( "widget", function() { + expect( 2 ); + var element = $( "#menu1" ).menu(), + widgetElement = element.menu( "widget" ); + equal( widgetElement.length, 1, "one element" ); + strictEqual( widgetElement[ 0 ], element[ 0 ], "same element" ); +}); + // TODO: test focus method // TODO: test blur method -- cgit v1.2.3 From dc7c26b8d1a75ae4784006a44d64134bb6a0354f Mon Sep 17 00:00:00 2001 From: Scott González Date: Sun, 26 Aug 2012 20:18:21 -0400 Subject: Progressbar tests: Added test for widget() method. --- tests/unit/progressbar/progressbar_methods.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/unit') diff --git a/tests/unit/progressbar/progressbar_methods.js b/tests/unit/progressbar/progressbar_methods.js index 89478b9b1..990739c6e 100644 --- a/tests/unit/progressbar/progressbar_methods.js +++ b/tests/unit/progressbar/progressbar_methods.js @@ -15,3 +15,11 @@ test( "value", function() { equal( element.progressbar( "value", 30), element, "chainable as setter" ); equal( element.progressbar( "option", "value" ), 30, "correct value after setter" ); }); + +test( "widget", function() { + expect( 2 ); + var element = $( "#progressbar" ).progressbar(), + widgetElement = element.progressbar( "widget" ); + equal( widgetElement.length, 1, "one element" ); + strictEqual( widgetElement[ 0 ], element[ 0 ], "same element" ); +}); -- cgit v1.2.3 From 383d0dbfaec3da07c07bf3cb424795c2f1439022 Mon Sep 17 00:00:00 2001 From: Scott González Date: Sun, 26 Aug 2012 20:19:35 -0400 Subject: Spinner tests: Added test for widget() method. --- tests/unit/spinner/spinner_methods.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/unit') diff --git a/tests/unit/spinner/spinner_methods.js b/tests/unit/spinner/spinner_methods.js index bafd949a7..af872f257 100644 --- a/tests/unit/spinner/spinner_methods.js +++ b/tests/unit/spinner/spinner_methods.js @@ -163,4 +163,12 @@ test( "value", function() { equal( element.spinner( "value" ), 9, "get value via value method" ); }); +test( "widget", function() { + expect( 2 ); + var element = $( "#spin" ).spinner(), + widgetElement = element.spinner( "widget" ); + equal( widgetElement.length, 1, "one element" ); + strictEqual( widgetElement[ 0 ], element.parent()[ 0 ], "parent element" ); +}); + })( jQuery ); -- cgit v1.2.3 From 1540f4afc82347cc77c5c6324e068c4bbd332456 Mon Sep 17 00:00:00 2001 From: Scott González Date: Sun, 26 Aug 2012 20:20:13 -0400 Subject: Whitespace --- tests/unit/tabs/tabs_methods.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests/unit') diff --git a/tests/unit/tabs/tabs_methods.js b/tests/unit/tabs/tabs_methods.js index a41d7069d..866ea1307 100644 --- a/tests/unit/tabs/tabs_methods.js +++ b/tests/unit/tabs/tabs_methods.js @@ -28,7 +28,7 @@ test( "enable", function() { }); test( "enable( index )", function() { - expect( 10 ); + expect( 10 ); var element = $( "#tabs1" ).tabs({ disabled: true }); disabled( element, true ); @@ -62,7 +62,7 @@ test( "disable", function() { }); test( "disable( index )", function() { - expect( 10 ); + expect( 10 ); var element = $( "#tabs1" ).tabs({ disabled: false }); disabled( element, false ); -- cgit v1.2.3 From 072919467dec74e2c4b2b3af0ed005a861cf6ff9 Mon Sep 17 00:00:00 2001 From: Scott González Date: Sun, 26 Aug 2012 20:20:43 -0400 Subject: Tabs tests: Added test for widget() method. --- tests/unit/tabs/tabs_methods.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests/unit') diff --git a/tests/unit/tabs/tabs_methods.js b/tests/unit/tabs/tabs_methods.js index 866ea1307..fa6535158 100644 --- a/tests/unit/tabs/tabs_methods.js +++ b/tests/unit/tabs/tabs_methods.js @@ -264,4 +264,12 @@ asyncTest( "load", function() { } }); +test( "widget", function() { + expect( 2 ); + var element = $( "#tabs1" ).tabs(), + widgetElement = element.tabs( "widget" ); + equal( widgetElement.length, 1, "one element" ); + strictEqual( widgetElement[ 0 ], element[ 0 ], "same element" ); +}); + }( jQuery ) ); -- cgit v1.2.3 From b22e3c36f27a9138ba2d1a665bdeded0b877ff6b Mon Sep 17 00:00:00 2001 From: Scott González Date: Sun, 26 Aug 2012 20:21:24 -0400 Subject: Tooltip tests: Added test for widget() method. --- tests/unit/tooltip/tooltip_methods.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'tests/unit') diff --git a/tests/unit/tooltip/tooltip_methods.js b/tests/unit/tooltip/tooltip_methods.js index ef783cbd3..0af1e06e9 100644 --- a/tests/unit/tooltip/tooltip_methods.js +++ b/tests/unit/tooltip/tooltip_methods.js @@ -59,14 +59,12 @@ test( "enable/disable", function() { $.fx.off = false; }); -/* -TODO currently tooltip doesn't override widget -can't return anything useful if no element is kept around and there's no useful reference -test("widget", function() { - var tooltip = $("#tooltipped1").tooltip(); - deepEqual(tooltip.tooltip("widget")[0], $(".ui-tooltip")[0]); - deepEqual(tooltip.tooltip("widget").end()[0], tooltip[0]); +test( "widget", function() { + expect( 2 ); + var element = $( "#tooltipped1" ).tooltip(), + widgetElement = element.tooltip( "widget" ); + equal( widgetElement.length, 1, "one element" ); + strictEqual( widgetElement[ 0 ], element[ 0 ], "same element" ); }); -*/ }( jQuery ) ); -- cgit v1.2.3 From 7852583980decd716f6c2ed37b1e1d7705332989 Mon Sep 17 00:00:00 2001 From: Jörn Zaefferer Date: Thu, 30 Aug 2012 15:20:36 +0200 Subject: Restore QUnit's now dead feature of using jQuery to reset the fixture. Fixes tooltip unit tests --- tests/unit/testsuite.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'tests/unit') diff --git a/tests/unit/testsuite.js b/tests/unit/testsuite.js index 4c6898fb3..06890d8d9 100644 --- a/tests/unit/testsuite.js +++ b/tests/unit/testsuite.js @@ -1,5 +1,7 @@ (function( $ ) { +var reset, jshintLoaded; + window.TestHelpers = {}; function includeStyle( url ) { @@ -10,6 +12,15 @@ function includeScript( url ) { document.write( "" ); } +reset = QUnit.reset; +QUnit.reset = function() { + // Ensure jQuery events and data on the fixture are properly removed + jQuery("#qunit-fixture").empty(); + // Let QUnit reset the fixture + reset.apply( this, arguments ); +}; + + QUnit.config.requireExpects = true; QUnit.config.urlConfig.push({ @@ -38,7 +49,7 @@ QUnit.config.urlConfig.push({ tooltip: "Skip running JSHint, e.g. within TestSwarm, where Jenkins runs it already" }); -var jshintLoaded = false; +jshintLoaded = false; TestHelpers.testJshint = function( module ) { if ( QUnit.urlParams.nojshint ) { return; -- cgit v1.2.3