Skip to content
Permalink
Browse files

Selectmenu: improved dropdown CSS style unit test

  • Loading branch information
fnagel committed Jan 13, 2012
1 parent 33bd0cd commit ba73886d3f0ad1c62eea92a7c8858f71cab6a19d
Showing with 12 additions and 4 deletions.
  1. +2 −0 tests/unit/selectmenu/selectmenu_methods.js
  2. +10 −4 tests/unit/selectmenu/selectmenu_options.js
@@ -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(),
@@ -13,19 +13,25 @@ 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"),
link = button.find("a"),
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);

0 comments on commit ba73886

Please sign in to comment.
You can’t perform that action at this time.