From fb87e1c557d347f11e123081c0b392aa5cd89532 Mon Sep 17 00:00:00 2001 From: Felix Nagel Date: Thu, 30 Aug 2012 23:38:56 +0200 Subject: [PATCH] Selectmenu tests: Added test for widget() method. --- tests/unit/selectmenu/selectmenu_methods.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/unit/selectmenu/selectmenu_methods.js b/tests/unit/selectmenu/selectmenu_methods.js index 9d84e4787..d90098dcf 100644 --- a/tests/unit/selectmenu/selectmenu_methods.js +++ b/tests/unit/selectmenu/selectmenu_methods.js @@ -128,5 +128,19 @@ test("refresh - disabled optgroup", function () { } }); +test( "widget", function() { + expect( 4 ); + var element = $('#speed').selectmenu(), + widgetElement = element.selectmenu( "widget" ), + menuWidgetElement = element.selectmenu( "menuWidget" ); + + element.selectmenu("refresh"); + + equal( widgetElement.length, 1, "widget: one element" ); + ok( widgetElement.is("a.ui-button"), "widget: button element" ); + + equal( menuWidgetElement.length, 1, "menuWidget: one element" ); + ok( menuWidgetElement.is("ul.ui-menu"), "menuWidget: menu element" ); +}); })( jQuery );