A11y: Fix for Fastpass issues on the Profile page (#40212)

* A11y: Fix for Fastpass issues on Profile page

* Chore: small fix

* Chore: fixes the tests
This commit is contained in:
Hugo Häggmark 2021-10-11 06:32:54 +02:00 committed by GitHub
parent 7756181ff9
commit 7706483654
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 4 deletions

View File

@ -51,6 +51,7 @@ export class UserOrganizations extends PureComponent<Props> {
onClick={() => {
this.props.setUserOrg(org);
}}
aria-label={`Switch to the organization named ${org.name}`}
>
Select
</Button>

View File

@ -251,7 +251,9 @@ describe('UserProfileEditPage', () => {
it('should call changeUserOrg', async () => {
const { props } = await getTestContext();
const orgsAdminSelectButton = () =>
within(getSelectors().orgsAdminRow()).getByRole('button', { name: /select/i });
within(getSelectors().orgsAdminRow()).getByRole('button', {
name: /switch to the organization named Third/i,
});
userEvent.click(orgsAdminSelectButton());
@ -267,7 +269,10 @@ describe('UserProfileEditPage', () => {
describe('and session is revoked', () => {
it('should call revokeUserSession', async () => {
const { props } = await getTestContext();
const sessionsRevokeButton = () => within(getSelectors().sessionsRow()).getByRole('button');
const sessionsRevokeButton = () =>
within(getSelectors().sessionsRow()).getByRole('button', {
name: /revoke user session/i,
});
userEvent.click(sessionsRevokeButton());

View File

@ -42,7 +42,12 @@ export class UserSessions extends PureComponent<Props> {
{session.browser} on {session.os} {session.osVersion}
</td>
<td>
<Button size="sm" variant="destructive" onClick={() => revokeUserSession(session.id)}>
<Button
size="sm"
variant="destructive"
onClick={() => revokeUserSession(session.id)}
aria-label="Revoke user session"
>
<Icon name="power" />
</Button>
</td>

View File

@ -37,7 +37,7 @@ export class UserTeams extends PureComponent<Props> {
return (
<tr key={index}>
<td className="width-4 text-center">
<img className="filter-table__avatar" src={team.avatarUrl} />
<img className="filter-table__avatar" src={team.avatarUrl} alt="" />
</td>
<td>{team.name}</td>
<td>{team.email}</td>