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-02-21 17:08:14 +00:00
|
|
|
|
2012-02-21 19:22:13 +00:00
|
|
|
var button = this.element.selectmenu("widget").parent(),
|
|
|
|
ul = this.element.selectmenu("menuWidget"),
|
|
|
|
link = button.find("a");
|
2012-01-13 18:49:42 +00:00
|
|
|
|
2012-02-21 17:08:14 +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 19:46:47 +00:00
|
|
|
this.element.selectmenu("close");
|
|
|
|
this.element.selectmenu("option", "dropdown", false);
|
|
|
|
this.element.selectmenu("open");
|
2012-02-21 17:08:14 +00:00
|
|
|
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);
|