aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/menu/menu_options.js
diff options
context:
space:
mode:
authorkborchers <kris.borchers@gmail.com>2012-01-22 11:26:41 -0600
committerkborchers <kris.borchers@gmail.com>2012-01-22 11:26:41 -0600
commit4f15e66f5373170caf307237b9a8b2c505ae3dbf (patch)
tree681877516d8766de3d9210c9ced9a08d3e9c20e6 /tests/unit/menu/menu_options.js
parent8c5c6e0a32a1e87cab575cbb265873fccbd416df (diff)
downloadjquery-ui-4f15e66f5373170caf307237b9a8b2c505ae3dbf.tar.gz
jquery-ui-4f15e66f5373170caf307237b9a8b2c505ae3dbf.zip
Menu: Added unit tests for the enable, disable and refresh methods as well as the disabled option. Cleaned up some variable names in unit tests.
Diffstat (limited to 'tests/unit/menu/menu_options.js')
-rw-r--r--tests/unit/menu/menu_options.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/unit/menu/menu_options.js b/tests/unit/menu/menu_options.js
index 03822fd74..479aab0d1 100644
--- a/tests/unit/menu/menu_options.js
+++ b/tests/unit/menu/menu_options.js
@@ -5,6 +5,34 @@
module("menu: options");
+test( "{ disabled: true }", function() {
+ expect( 2 );
+ var menu = $( "#menu1" ).menu({
+ disabled: true,
+ select: function(event, ui) {
+ menu_log();
+ }
+ });
+ ok(menu.is(".ui-state-disabled"),"Missing ui-state-disabled class");
+ menu_log("click",true);
+ menu_click(menu,"1");
+ menu_log("afterclick");
+ equals( $("#log").html(), "afterclick,click,", "Click order not valid.");
+});
+test( "{ disabled: false }", function() {
+ expect( 2 );
+ var menu = $( "#menu1" ).menu({
+ disabled: false,
+ select: function(event, ui) {
+ menu_log();
+ }
+ });
+ ok(menu.not(".ui-state-disabled"),"Has ui-state-disabled class");
+ menu_log("click",true);
+ menu_click(menu,"1");
+ menu_log("afterclick");
+ equals( $("#log").html(), "afterclick,1,click,", "Click order not valid.");
+});
})(jQuery);