jquery-ui/tests/unit/selectmenu/selectmenu_options.js

32 lines
877 B
JavaScript
Raw Normal View History

2011-11-25 10:32:44 +00:00
(function ($) {
2011-11-25 10:32:44 +00:00
module("selectmenu: options", {
setup: function () {
this.element = $("#speed");
this.element.selectmenu();
}
});
2011-11-25 10:32:44 +00:00
test("appendTo another element", function () {
expect(2);
2011-11-25 10:32:44 +00:00
ok(this.element.selectmenu("option", "appendTo", "#qunit-fixture"), "appendTo accepts selector");
ok($("#qunit-fixture").find(".ui-selectmenu-menu").length, "selectmenu appendedTo other element");
2011-11-25 10:32:44 +00:00
});
test("dropdown false", function () {
expect(1);
ok(this.element.selectmenu("option", "dropdown", false), "accepts false");
});
test("value option", function () {
2011-11-25 10:32:44 +00:00
expect(1);
this.element.selectmenu("option", "value", "jQuery UI");
2011-11-25 10:32:44 +00:00
equals(this.element.selectmenu("option", "value"), "jQuery UI", "should be set to 'jQuery UI'");
2011-11-25 10:32:44 +00:00
});
})(jQuery);