diff options
author | David Bolter <david.bolter@gmail.com> | 2008-11-13 15:51:09 +0000 |
---|---|---|
committer | David Bolter <david.bolter@gmail.com> | 2008-11-13 15:51:09 +0000 |
commit | 976b9b57bb0156767e6fd88b3adf746674a9f971 (patch) | |
tree | 32cd8a290fc617796b8d00be2d63fa78a253b2fa /tests | |
parent | d3f564e02d2f52cf03354a0a651d1fc11a919217 (diff) | |
download | jquery-ui-976b9b57bb0156767e6fd88b3adf746674a9f971.tar.gz jquery-ui-976b9b57bb0156767e6fd88b3adf746674a9f971.zip |
Added accordion keyboard and ARIA support, and tests. Mozilla needs this for website. (partial review: Scott González, fix for 3553)
Diffstat (limited to 'tests')
-rw-r--r-- | tests/accordion.js | 18 |
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); |