aboutsummaryrefslogtreecommitdiffstats
path: root/tests/accordion.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/accordion.js')
-rw-r--r--tests/accordion.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/accordion.js b/tests/accordion.js
index ff3719b41..6ede9bc06 100644
--- a/tests/accordion.js
+++ b/tests/accordion.js
@@ -129,4 +129,22 @@ test("accordionchange event, open closed and close again", function() {
.accordion("activate", 0);
});
+test("accessibility", function () {
+ expect(9);
+ var ac = $('#list1').accordion().accordion("activate", 1);
+ var headers = $(".ui-accordion-header");
+
+ equals( headers.eq(1).attr("tabindex"), "0", "active header should have tabindex=0");
+ equals( headers.eq(0).attr("tabindex"), "-1", "inactive header should have tabindex=-1");
+ equals( ac.attr("role"), "tablist", "main role");
+ equals( headers.attr("role"), "tab", "tab roles");
+ equals( headers.next().attr("role"), "tabpanel", "tabpanel roles");
+ equals( headers.eq(1).attr("aria-expanded"), "true", "active tab has aria-expanded");
+ equals( headers.eq(0).attr("aria-expanded"), "false", "inactive tab has aria-expanded");
+ ac.accordion("activate", 0);
+ equals( headers.eq(0).attr("aria-expanded"), "true", "newly active tab has aria-expanded");
+ equals( headers.eq(1).attr("aria-expanded"), "false", "newly inactive tab has aria-expanded");
+});
+
+
})(jQuery);