2011-11-25 10:32:44 +00:00
|
|
|
(function ($) {
|
2011-10-19 17:47:02 +00:00
|
|
|
|
2012-01-13 18:49:42 +00:00
|
|
|
module("selectmenu: options", {
|
|
|
|
setup: function () {
|
|
|
|
this.element = $("#speed").selectmenu();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
test("appendTo another element", function () {
|
|
|
|
expect(2);
|
|
|
|
|
|
|
|
ok(this.element.selectmenu("option", "appendTo", "#qunit-fixture"), "appendTo accepts selector");
|
|
|
|
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-01-13 19:46:47 +00:00
|
|
|
expect(4);
|
2012-01-13 18:49:42 +00:00
|
|
|
|
|
|
|
var widget = this.element.selectmenu("widget"),
|
|
|
|
button = widget.filter(".ui-selectmenu-button"),
|
|
|
|
link = button.find("a"),
|
|
|
|
menu = widget.filter(".ui-selectmenu-menu"),
|
|
|
|
ul = widget.find("ul");
|
|
|
|
|
2012-01-13 19:46:47 +00:00
|
|
|
this.element.selectmenu("open");
|
|
|
|
ok( link.hasClass("ui-corner-top") && !link.hasClass("ui-corner-all"), "button styles dropdown");
|
|
|
|
ok( ul.hasClass("ui-corner-bottom") && !ul.hasClass("ui-corner-all"), "menu styles dropdown");
|
2012-01-13 18:49:42 +00:00
|
|
|
|
2012-01-13 19:46:47 +00:00
|
|
|
this.element.selectmenu("close");
|
|
|
|
this.element.selectmenu("option", "dropdown", false);
|
|
|
|
this.element.selectmenu("open");
|
|
|
|
ok( !link.hasClass("ui-corner-top") && link.hasClass("ui-corner-all"), "button styles pop-up");
|
|
|
|
ok( !ul.hasClass("ui-corner-bottom") && ul.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);
|