Skip to content

Commit abde068

Browse files
committed
Add test case for just aria-hidden
1 parent 4527dda commit abde068

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/linters/accessibility/no_aria_hidden_on_focusable_counter_test.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@ def test_does_not_warn_if_link_does_not_have_aria_hidden
1414
assert_empty @linter.offenses
1515
end
1616

17+
def test_does_not_consider_aria_hidden_as_aria_hidden_true
18+
# aria-hidden is not the same as aria-hidden="true". Not ideal code.
19+
@file = "<a aria-hidden href='github.com'>GitHub</a>"
20+
@linter.run(processed_source)
21+
22+
assert_empty @linter.offenses
23+
end
24+
1725
def test_does_not_warn_if_link_has_aria_hidden_false
1826
@file = "<a aria-hidden='false' href='github.com'>GitHub</a>"
1927
@linter.run(processed_source)
@@ -29,7 +37,7 @@ def test_does_not_warn_when_link_has_aria_hidden_true_and_is_not_focusable
2937
end
3038

3139
def test_warns_when_element_has_aria_hidden_true_and_not_tab_focusable
32-
@file = "<div role='button' tabindex='0' a aria-hidden='true'>GitHub</a>"
40+
@file = "<div role='button' tabindex='0' aria-hidden='true'>GitHub</a>"
3341
@linter.run(processed_source)
3442
refute_empty @linter.offenses
3543
end

0 commit comments

Comments
 (0)