aboutsummaryrefslogtreecommitdiffstats
path: root/tests/unit/selectmenu/selectmenu_options.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/selectmenu/selectmenu_options.js')
-rw-r--r--tests/unit/selectmenu/selectmenu_options.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/unit/selectmenu/selectmenu_options.js b/tests/unit/selectmenu/selectmenu_options.js
new file mode 100644
index 000000000..440df04be
--- /dev/null
+++ b/tests/unit/selectmenu/selectmenu_options.js
@@ -0,0 +1,41 @@
+(function ($) {
+
+module("selectmenu: options");
+
+test("appendTo another element", function () {
+ expect(2);
+
+ var element = $("#speed").selectmenu();
+
+ ok(element.selectmenu("option", "appendTo", "#qunit-fixture"), "appendTo accepts selector");
+ ok($("#qunit-fixture").find(".ui-selectmenu-menu").length, "selectmenu appendedTo other element");
+});
+
+
+test("dropdown: CSS styles", function () {
+ expect(2);
+
+ var element = $("#speed").selectmenu(),
+ button = element.selectmenu("widget"),
+ menu = element.selectmenu("menuWidget");
+
+ element.selectmenu("open");
+ ok( button.hasClass("ui-corner-top") && !button.hasClass("ui-corner-all") && button.find("span.ui-icon").hasClass("ui-icon-triangle-1-s"), "button styles dropdown");
+ ok( menu.hasClass("ui-corner-bottom") && !menu.hasClass("ui-corner-all"), "menu styles dropdown");
+});
+
+test("pop-up: CSS styles", function () {
+ expect(2);
+
+ var element = $("#speed").selectmenu({
+ dropdown: false
+ }),
+ button = element.selectmenu("widget"),
+ menu = element.selectmenu("menuWidget");
+
+ element.selectmenu("close");
+ ok( !button.hasClass("ui-corner-top") && button.hasClass("ui-corner-all") && button.find("span.ui-icon").hasClass("ui-icon-triangle-2-n-s"), "button styles pop-up");
+ ok( !menu.hasClass("ui-corner-bottom") && menu.hasClass("ui-corner-all"), "menu styles pop-up");
+});
+
+})(jQuery);