diff options
Diffstat (limited to 'tests/unit/menu')
-rw-r--r-- | tests/unit/menu/all.html | 2 | ||||
-rw-r--r-- | tests/unit/menu/menu_methods.js | 40 |
2 files changed, 25 insertions, 17 deletions
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 @@ <meta charset="utf-8"> <title>jQuery UI Menu Test Suite</title> - <script src="../../../jquery-1.7.2.js"></script> + <script src="../../../jquery-1.8.0.js"></script> <link rel="stylesheet" href="../../../external/qunit.css"> <link rel="stylesheet" href="../qunit-composite.css"> diff --git a/tests/unit/menu/menu_methods.js b/tests/unit/menu/menu_methods.js index 510ddb1d7..f9241f27b 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({ @@ -44,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 @@ -68,20 +92,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 ); |