2011-11-25 10:32:44 +00:00
|
|
|
(function ($) {
|
2011-10-19 17:47:02 +00:00
|
|
|
|
2012-02-26 00:24:52 +00:00
|
|
|
module("selectmenu: options");
|
2012-01-13 18:49:42 +00:00
|
|
|
|
|
|
|
test("appendTo another element", function () {
|
|
|
|
expect(2);
|
2012-05-16 18:43:42 +00:00
|
|
|
|
2012-02-26 00:24:52 +00:00
|
|
|
element = $("#speed").selectmenu();
|
2012-05-16 18:43:42 +00:00
|
|
|
|
2012-02-26 00:24:52 +00:00
|
|
|
ok(element.selectmenu("option", "appendTo", "#qunit-fixture"), "appendTo accepts selector");
|
2012-01-13 18:49:42 +00:00
|
|
|
ok($("#qunit-fixture").find(".ui-selectmenu-menu").length, "selectmenu appendedTo other element");
|
|
|
|
});
|
|
|
|
|
2012-01-13 19:46:47 +00:00
|
|
|
|
2012-01-13 18:49:42 +00:00
|
|
|
test("dropdown: CSS styles", function () {
|
2012-02-26 00:24:52 +00:00
|
|
|
expect(2);
|
|
|
|
|
|
|
|
var element = $("#speed").selectmenu(),
|
|
|
|
button = element.selectmenu("widget"),
|
|
|
|
menu = element.selectmenu("menuWidget");
|
2012-02-21 17:08:14 +00:00
|
|
|
|
2012-02-26 00:24:52 +00:00
|
|
|
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);
|
2012-01-13 18:49:42 +00:00
|
|
|
|
2012-02-26 00:24:52 +00:00
|
|
|
var element = $("#speed").selectmenu({
|
|
|
|
dropdown: false
|
|
|
|
}),
|
|
|
|
button = element.selectmenu("widget"),
|
|
|
|
menu = element.selectmenu("menuWidget");
|
2012-02-21 17:08:14 +00:00
|
|
|
|
2012-02-26 00:24:52 +00:00
|
|
|
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");
|
2012-01-13 18:49:42 +00:00
|
|
|
});
|
2011-11-25 10:32:44 +00:00
|
|
|
|
|
|
|
})(jQuery);
|