From fb3a5d40106a83d10734f203189dc390cfaa0b94 Mon Sep 17 00:00:00 2001 From: David Bolter Date: Mon, 22 Sep 2008 15:47:41 +0000 Subject: Added ariaRole and ariaState to ui.core with tests. Added ARIA role and state to ui.dialog Fixes #3350 (Inspired by jARIA plugin from Chris Hoffman) --- tests/core.html | 1 + tests/core.js | 15 +++++++++++++++ 2 files changed, 16 insertions(+) (limited to 'tests') diff --git a/tests/core.html b/tests/core.html index 510d4f3a7..5da16011a 100644 --- a/tests/core.html +++ b/tests/core.html @@ -65,6 +65,7 @@ +
diff --git a/tests/core.js b/tests/core.js index 144c27265..f9885e684 100644 --- a/tests/core.js +++ b/tests/core.js @@ -53,4 +53,19 @@ test("tabbable - tabindex", function() { ok(!$('#input4-4').is(':tabbable'), 'input, tabindex -50'); }); +test("aria", function() { + expect(10); + + ok(!$('#aria').attr('role'), 'role is empty via attr'); + ok(!$('#aria').ariaRole(), 'role is empty via ariaRole'); + equals($('#aria').ariaRole('dialog').attr('role').replace(/^wairole:/, ""), 'dialog', 'role is dialog'); + equals($('#aria').ariaRole(), 'dialog', 'role is dialog'); + equals($('#aria').ariaRole('tablist').attr('role').replace(/^wairole:/, ""), 'tablist', 'role is tablist via attr'); + equals($('#aria').ariaRole(), 'tablist', 'role is tablist via ariaRole'); + ok(!$('#aria').attr('expanded'), 'state expanded absent via attr'); + ok(!$('#aria').ariaState('expanded'), 'state expanded absent via ariaState'); + equals($('#aria').ariaState('expanded', 'true').ariaState('expanded'), 'true', 'aria expanded is true'); + equals($('#aria').ariaState('expanded', 'false').ariaState('expanded'), 'false', 'aria expanded is false'); +}); + })(jQuery); -- cgit v1.2.3