Selectmenu: improved dropdown CSS style unit test

This commit is contained in:
Felix Nagel 2012-01-13 20:46:47 +01:00
parent 33bd0cd9fb
commit ba73886d3f
2 changed files with 12 additions and 4 deletions

View File

@ -96,6 +96,7 @@ test("refresh - disabled select", function () {
equals( menu.children("ul").attr("aria-disabled"), "true", "mene ARIA" );
});
test("refresh - disabled option", function () {
expect(2);
@ -113,6 +114,7 @@ test("refresh - disabled option", function () {
ok( disabledItem.children("a").length <= 0, "has no link" );
});
test("refresh - disabled optgroup", function () {
var element = $('#files').selectmenu(),

View File

@ -13,8 +13,9 @@ test("appendTo another element", function () {
ok($("#qunit-fixture").find(".ui-selectmenu-menu").length, "selectmenu appendedTo other element");
});
test("dropdown: CSS styles", function () {
expect(2);
expect(4);
var widget = this.element.selectmenu("widget"),
button = widget.filter(".ui-selectmenu-button"),
@ -22,10 +23,15 @@ test("dropdown: CSS styles", function () {
menu = widget.filter(".ui-selectmenu-menu"),
ul = widget.find("ul");
this.element.selectmenu("open");
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");
ok( link.hasClass("ui-corner-top") && !link.hasClass("ui-corner-all"), "button styles");
ok( ul.hasClass("ui-corner-bottom") && !ul.hasClass("ui-corner-all"), "menu styles");
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");
});
})(jQuery);