Permalink
Browse files

Tests: equals() -> equal().

  • Loading branch information...
1 parent b4d9eee commit 94f85149db2a8b2540f9b204c14d57d8b087fbf6 @scottgonzalez scottgonzalez committed Mar 1, 2012
@@ -13,23 +13,23 @@ test("accessibility", function () {
expect(12 + links.length * 2);
- equals( button.attr("role"), "combobox", "button link role" );
- equals( button.attr("aria-haspopup"), "true", "button link aria-haspopup" );
- equals( button.attr("aria-expanded"), "false", "button link aria-expanded" );
- equals( button.attr("aria-autocomplete"), "list", "button link aria-autocomplete" );
- equals( button.attr("aria-owns"), menu.attr("id"), "button link aria-owns" );
- equals( button.attr("tabindex"), 0, "button link tabindex" );
+ equal( button.attr("role"), "combobox", "button link role" );
+ equal( button.attr("aria-haspopup"), "true", "button link aria-haspopup" );
+ equal( button.attr("aria-expanded"), "false", "button link aria-expanded" );
+ equal( button.attr("aria-autocomplete"), "list", "button link aria-autocomplete" );
+ equal( button.attr("aria-owns"), menu.attr("id"), "button link aria-owns" );
+ equal( button.attr("tabindex"), 0, "button link tabindex" );
- equals( menu.attr("role"), "listbox", "menu role" );
- equals( menu.attr("aria-labelledby"), button.attr("id"), "menu aria-labelledby" );
- equals( menu.attr("aria-hidden"), "true", "menu aria-hidden" );
- equals( menu.attr("tabindex"), 0, "menu tabindex" );
- equals( menu.attr("aria-activedescendant"), links.eq(element[0].selectedIndex).attr("id"), "menu aria-activedescendant" );
+ equal( menu.attr("role"), "listbox", "menu role" );
+ equal( menu.attr("aria-labelledby"), button.attr("id"), "menu aria-labelledby" );
+ equal( menu.attr("aria-hidden"), "true", "menu aria-hidden" );
+ equal( menu.attr("tabindex"), 0, "menu tabindex" );
+ equal( menu.attr("aria-activedescendant"), links.eq(element[0].selectedIndex).attr("id"), "menu aria-activedescendant" );
$.each( links, function(index){
- equals( $(this).attr("role"), "option", "menu link #" + index +" role" );
- equals( $(this).attr("tabindex"), -1, "menu link #" + index +" tabindex" );
+ equal( $(this).attr("role"), "option", "menu link #" + index +" role" );
+ equal( $(this).attr("tabindex"), -1, "menu link #" + index +" tabindex" );
});
- equals( links.eq(element[0].selectedIndex).attr("aria-selected"), "true", "selected menu link aria-selected" );
+ equal( links.eq(element[0].selectedIndex).attr("aria-selected"), "true", "selected menu link aria-selected" );
});
@@ -55,17 +55,17 @@ $.each([
var links = menu.find("li.ui-menu-item a");
button.simulate( "keydown", { keyCode: $.ui.keyCode.DOWN } );
- equals( menu.attr("aria-activedescendant"), links.eq(element[0].selectedIndex).attr("id"), "after keydown menu aria-activedescendant" );
- equals( links.eq(element[0].selectedIndex).attr("aria-selected"), "true", "after keydown selected menu link aria-selected" );
- equals( element.find("option:selected").val(), selected.next("option").val() , "after keydown original select state" );
- equals( button.text(), selected.next("option").text(), "after keydown button text" );
+ equal( menu.attr("aria-activedescendant"), links.eq(element[0].selectedIndex).attr("id"), "after keydown menu aria-activedescendant" );
+ equal( links.eq(element[0].selectedIndex).attr("aria-selected"), "true", "after keydown selected menu link aria-selected" );
+ equal( element.find("option:selected").val(), selected.next("option").val() , "after keydown original select state" );
+ equal( button.text(), selected.next("option").text(), "after keydown button text" );
button.simulate( "click" );
menu.find("a").last().simulate( "mouseover" ).trigger( "click" );
- equals( menu.attr("aria-activedescendant"), links.eq(element[0].selectedIndex).attr("id"), "after click menu aria-activedescendant" );
- equals( links.eq(element[0].selectedIndex).attr("aria-selected"), "true", "after click selected menu link aria-selected" );
- equals( element.find("option:selected").val(), element.find("option").last().val(), "after click original select state" );
- equals( button.text(), element.find("option").last().text(), "after click button text" );
+ equal( menu.attr("aria-activedescendant"), links.eq(element[0].selectedIndex).attr("id"), "after click menu aria-activedescendant" );
+ equal( links.eq(element[0].selectedIndex).attr("aria-selected"), "true", "after click selected menu link aria-selected" );
+ equal( element.find("option:selected").val(), element.find("option").last().val(), "after click original select state" );
+ equal( button.text(), element.find("option").last().text(), "after click button text" );
});
});
@@ -12,10 +12,10 @@ test("change", function () {
this.element.selectmenu({
change: function (event, ui) {
ok(event, "change event fired on change");
- equals(event.type, "selectmenuchange", "event type set to selectmenuchange");
+ equal(event.type, "selectmenuchange", "event type set to selectmenuchange");
ok(ui, "ui object is passed as second argument to event handler");
- equals(ui.item.element[0].nodeName, "OPTION", "ui.item.element[0] points to original option element");
- equals(ui.item.value, value, "ui.item.value property updated correctly");
+ equal(ui.item.element[0].nodeName, "OPTION", "ui.item.element[0] points to original option element");
+ equal(ui.item.value, value, "ui.item.value property updated correctly");
}
});
@@ -34,7 +34,7 @@ test("close", function () {
this.element.selectmenu({
close: function (event, ui) {
ok(event, "close event fired on close");
- equals(event.type, "selectmenuclose", "event type set to selectmenuclose");
+ equal(event.type, "selectmenuclose", "event type set to selectmenuclose");
ok(ui, "ui object is passed as second argument to event handler");
}
});
@@ -53,9 +53,9 @@ test("focus", function () {
counter++;
if (counter === 1) {
ok(event, "focus event fired on mouseover");
- equals(event.type, "selectmenufocus", "event type set to selectmenufocus");
+ equal(event.type, "selectmenufocus", "event type set to selectmenufocus");
ok(ui, "ui object is passed as second argument to event handler");
- equals(ui.item.element[0].nodeName, "OPTION", "ui points to original option element");
+ equal(ui.item.element[0].nodeName, "OPTION", "ui points to original option element");
}
}
});
@@ -74,7 +74,7 @@ test("open", function () {
this.element.selectmenu({
open: function (event, ui) {
ok(event, "open event fired on open");
- equals(event.type, "selectmenuopen", "event type set to selectmenuopen");
+ equal(event.type, "selectmenuopen", "event type set to selectmenuopen");
ok(ui, "ui object is passed as second argument to event handler");
}
});
@@ -89,9 +89,9 @@ test("select", function () {
this.element.selectmenu({
select: function (event, ui) {
ok(event, "select event fired on item select");
- equals(event.type, "selectmenuselect", "event type set to selectmenuselect");
+ equal(event.type, "selectmenuselect", "event type set to selectmenuselect");
ok(ui, "ui object is passed as second argument to event handler");
- equals(ui.item.element[0].nodeName, "OPTION", "ui points to original option element");
+ equal(ui.item.element[0].nodeName, "OPTION", "ui points to original option element");
}
});
@@ -18,11 +18,11 @@ test( "open / close", function() {
element.selectmenu("open");
ok( menu.is( ":visible" ), "open: menu visible" );
- equals( menu.attr("aria-hidden"), "false", "open: menu aria-disabled" );
+ equal( menu.attr("aria-hidden"), "false", "open: menu aria-disabled" );
element.selectmenu("close");
ok( menu.is( ":hidden" ), "close: menu hidden" );
- equals( menu.attr("aria-hidden"), "true", "close: menu aria-disabled" );
+ equal( menu.attr("aria-hidden"), "true", "close: menu aria-disabled" );
});
@@ -35,17 +35,17 @@ test("enable / disable", function () {
element.selectmenu("disable");
ok( element.selectmenu("option", "disabled"), "disable: widget option" );
- equals( element.attr("disabled"), "disabled", "disable: native select disabled" );
- equals( button.attr("aria-disabled"), "true", "disable: button wrapper ARIA" );
- equals( button.attr("tabindex"), -1, "disable: button tabindex" );
- equals( menu.attr("aria-disabled"), "true", "disable: menu wrapper ARIA" );
+ equal( element.attr("disabled"), "disabled", "disable: native select disabled" );
+ equal( button.attr("aria-disabled"), "true", "disable: button wrapper ARIA" );
+ equal( button.attr("tabindex"), -1, "disable: button tabindex" );
+ equal( menu.attr("aria-disabled"), "true", "disable: menu wrapper ARIA" );
element.selectmenu("enable");
ok( !element.selectmenu("option", "disabled"), "enable: widget option" );
- equals( element.attr("disabled"), undefined, "enable: native select disabled" );
- equals( button.attr("aria-disabled"), "false", "enable: button wrapper ARIA" );
- equals( button.attr("tabindex"), 0, "enable: button tabindex" );
- equals( menu.attr("aria-disabled"), "false", "enable: menu wrapper ARIA" );
+ equal( element.attr("disabled"), undefined, "enable: native select disabled" );
+ equal( button.attr("aria-disabled"), "false", "enable: button wrapper ARIA" );
+ equal( button.attr("tabindex"), 0, "enable: button tabindex" );
+ equal( menu.attr("aria-disabled"), "false", "enable: menu wrapper ARIA" );
});
@@ -63,9 +63,9 @@ test("refresh - structure", function () {
.text("Changed value");
element.selectmenu("refresh");
- equals( element.find("option").length, menu.find("li").not(".ui-selectmenu-optgroup").length, "menu item length" );
- equals( element.find("option").last().text(), menu.find("li").not(".ui-selectmenu-optgroup").last().text(), "added item" );
- equals( element.find("option").first().text(), menu.find("li").not(".ui-selectmenu-optgroup").first().text(), "changed item" );
+ equal( element.find("option").length, menu.find("li").not(".ui-selectmenu-optgroup").length, "menu item length" );
+ equal( element.find("option").last().text(), menu.find("li").not(".ui-selectmenu-optgroup").last().text(), "added item" );
+ equal( element.find("option").first().text(), menu.find("li").not(".ui-selectmenu-optgroup").first().text(), "changed item" );
});
@@ -80,9 +80,9 @@ test("refresh - disabled select", function () {
element.selectmenu("refresh");
ok( element.selectmenu("option", "disabled"), "widget option" );
- equals( button.attr("aria-disabled"), "true", "button wrapper ARIA" );
- equals( button.attr("tabindex"), -1, "button tabindex" );
- equals( menu.attr("aria-disabled"), "true", "menu wrapper ARIA" );
+ equal( button.attr("aria-disabled"), "true", "button wrapper ARIA" );
+ equal( button.attr("tabindex"), -1, "button tabindex" );
+ equal( menu.attr("aria-disabled"), "true", "menu wrapper ARIA" );
});
@@ -119,7 +119,7 @@ test("refresh - disabled optgroup", function () {
var item = menu.find("li.ui-selectmenu-optgroup").first();
ok( item.hasClass("ui-state-disabled"), "class" );
- equals( menu.find("li").not(".ui-selectmenu-optgroup").filter(".ui-state-disabled").length, originalDisabledOptions.length, "disabled options" );
+ equal( menu.find("li").not(".ui-selectmenu-optgroup").filter(".ui-state-disabled").length, originalDisabledOptions.length, "disabled options" );
for ( var i = 0; i < originalDisabledOptions.length; i++ ) {
item = item.next("li");
ok( item.hasClass("ui-state-disabled"), "item #" + i + ": class" );

0 comments on commit 94f8514

Please sign in to comment.