mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Add aria-labels to topic list items (#9048)
* FIX: Add aria-labels to topic list items Before this fix you could navigate the topic list using a screen reader and a keyboard but some of the items were not as descriptive as they could be. The newly added labels make it easier to understand what you are tabbing over. context: https://meta.discourse.org/t/accessibility-aria-attributes-are-not-defined-for-links-under-replies-category/142539 * Update app/assets/javascripts/discourse/lib/utilities.js.es6 Co-Authored-By: Régis Hanol <regis@hanol.fr> * Multiline fix * Fix more tests Co-authored-by: Régis Hanol <regis@hanol.fr>
This commit is contained in:
@@ -89,7 +89,7 @@ QUnit.test("avatarImg", assert => {
|
||||
size: "tiny",
|
||||
title: "evilest trout"
|
||||
}),
|
||||
"<img alt='' width='20' height='20' src='/path/to/avatar/40.png' class='avatar' title='evilest trout'>",
|
||||
"<img alt='' width='20' height='20' src='/path/to/avatar/40.png' class='avatar' title='evilest trout' aria-label='evilest trout'>",
|
||||
"it adds a title if supplied"
|
||||
);
|
||||
|
||||
|
||||
@@ -459,7 +459,7 @@ QUnit.test("computed labels", assert => {
|
||||
const computedUsernameLabel = usernameLabel.compute(row);
|
||||
assert.equal(
|
||||
computedUsernameLabel.formatedValue,
|
||||
"<a href='/admin/users/1/joffrey'><img alt='' width='20' height='20' src='/' class='avatar' title='joffrey'><span class='username'>joffrey</span></a>"
|
||||
"<a href='/admin/users/1/joffrey'><img alt='' width='20' height='20' src='/' class='avatar' title='joffrey' aria-label='joffrey'><span class='username'>joffrey</span></a>"
|
||||
);
|
||||
assert.equal(computedUsernameLabel.value, "joffrey");
|
||||
|
||||
@@ -542,6 +542,6 @@ QUnit.test("computed labels", assert => {
|
||||
const userLink = computedLabels[0].compute(row).formatedValue;
|
||||
assert.equal(
|
||||
userLink,
|
||||
"<a href='/forum/admin/users/1/joffrey'><img alt='' width='20' height='20' src='/forum/' class='avatar' title='joffrey'><span class='username'>joffrey</span></a>"
|
||||
"<a href='/forum/admin/users/1/joffrey'><img alt='' width='20' height='20' src='/forum/' class='avatar' title='joffrey' aria-label='joffrey'><span class='username'>joffrey</span></a>"
|
||||
);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user