aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2013-02-09 03:26:53 +0100
committerFelix Nagel <info@felixnagel.com>2013-02-09 03:26:53 +0100
commitb81bb0b983687b1efc09577bf128b8a5b7aa5d7b (patch)
treedfbf4fd2b2968dc03b4ba5948d0713055b667024 /tests
parent110cab160e350c072702fed45ceac6cefae61992 (diff)
downloadjquery-ui-b81bb0b983687b1efc09577bf128b8a5b7aa5d7b.tar.gz
jquery-ui-b81bb0b983687b1efc09577bf128b8a5b7aa5d7b.zip
Selectmenu tests: add unit test to make sure button text is changed when refreshing selectmenu
Diffstat (limited to 'tests')
-rw-r--r--tests/unit/selectmenu/selectmenu_methods.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/unit/selectmenu/selectmenu_methods.js b/tests/unit/selectmenu/selectmenu_methods.js
index e8e62fa28..2f2caa5d0 100644
--- a/tests/unit/selectmenu/selectmenu_methods.js
+++ b/tests/unit/selectmenu/selectmenu_methods.js
@@ -68,6 +68,26 @@ test("refresh - structure", function () {
equal( element.find("option").first().text(), menu.find("li").not(".ui-selectmenu-optgroup").first().text(), "changed item" );
});
+test("refresh - change selected option", function () {
+ expect(3);
+
+ var element = $("#speed").selectmenu(),
+ menu = element.selectmenu("menuWidget").parent(),
+ button = element.selectmenu("widget");
+
+ equal( element.find("option:selected").text(), button.text(), "button text after init" );
+
+ button.simulate( "focus" );
+
+ equal( element.find("option:selected").text(), button.text(), "button text after focus" );
+
+ element.find("option").eq(2).removeAttr("selected");
+ element.find("option").eq(0).attr("selected", "selected");
+ element.selectmenu("refresh");
+
+ equal( element.find("option:selected").text(), button.text(), "button text after changing selected option" );
+});
+
test("refresh - disabled select", function () {
expect(4);