mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 23:31:21 +08:00
FIX: Ensure the like button always has a title, for accessibility (#6525)
The like button previously didn't have a title for anonymous users, because the `canToggleLike` flag wasn't set, but the `liked` flag wasn't set either. This made the button inaccessible to blind users.
This commit is contained in:

committed by
Régis Hanol

parent
e955a7b49d
commit
05438d99a8
@ -206,6 +206,12 @@ widgetTest("anon liking", {
|
||||
assert.ok(!!this.$(".actions button.like").length);
|
||||
assert.ok(this.$(".actions button.like-count").length === 0);
|
||||
|
||||
assert.equal(
|
||||
this.$("button.like").attr("title"),
|
||||
I18n.t("post.controls.like"),
|
||||
`shows the right button title for anonymous users`
|
||||
);
|
||||
|
||||
await click(".actions button.like");
|
||||
assert.ok(this.loginShown);
|
||||
}
|
||||
|
Reference in New Issue
Block a user