🚸(frontend) improve screen reading navigation

- add aria-hidden and empty alt attributes for screen readers
to ignore decorative svg and images.
- remove icon from input field used to name a group
- update translations
- update related e2e and components tests
This commit is contained in:
daproclaima
2024-08-01 13:40:43 +02:00
committed by Sebastien Nobour
parent 72340db74c
commit 14deca13f4
29 changed files with 87 additions and 72 deletions

View File

@@ -74,7 +74,7 @@ export const addNewMember = async (
// Choose a role
await page.getByRole('radio', { name: role }).click();
await page.getByRole('button', { name: 'Validate' }).click();
await page.getByRole('button', { name: 'Add to group' }).click();
const table = page.getByLabel('List members card').getByRole('table');

View File

@@ -19,7 +19,8 @@ test.describe('Header', () => {
header.getByAltText('Freedom Equality Fraternity Logo'),
).toBeVisible();
await expect(header.getByAltText('Régie Logo')).toBeVisible();
await expect(header.getByRole('link', { name: 'Régie' })).toBeVisible();
await expect(header.locator('h2').getByText('Régie')).toHaveCSS(
'color',
'rgb(0, 0, 145)',
@@ -35,7 +36,7 @@ test.describe('Header', () => {
}),
).toBeVisible();
await expect(header.getByAltText('Language Icon')).toBeVisible();
await expect(header.getByRole('combobox').getByText('EN')).toBeVisible();
await expect(header.getByText('My account')).toBeVisible();
});

View File

@@ -23,7 +23,9 @@ test.describe('Members Create', () => {
page.getByLabel(/Find a member to add to the team/),
).toBeVisible();
await expect(page.getByRole('button', { name: 'Validate' })).toBeVisible();
await expect(
page.getByRole('button', { name: 'Add to group' }),
).toBeVisible();
await expect(page.getByRole('button', { name: 'Cancel' })).toBeVisible();
});
@@ -124,7 +126,7 @@ test.describe('Members Create', () => {
response.url().includes('/accesses/') && response.status() === 201,
);
await page.getByRole('button', { name: 'Validate' }).click();
await page.getByRole('button', { name: 'Add to group' }).click();
// Check invitation sent
await expect(page.getByText(`Invitation sent to ${email}`)).toBeVisible();
@@ -169,7 +171,7 @@ test.describe('Members Create', () => {
response.url().includes('/accesses/') && response.status() === 201,
);
await page.getByRole('button', { name: 'Validate' }).click();
await page.getByRole('button', { name: 'Add to group' }).click();
await expect(
page.getByText(`Member ${users[0].name} added to the team`),
@@ -207,7 +209,7 @@ test.describe('Members Create', () => {
response.url().includes('/invitations/') && response.status() === 201,
);
await page.getByRole('button', { name: 'Validate' }).click();
await page.getByRole('button', { name: 'Add to group' }).click();
// Check invitation sent
await expect(page.getByText(`Invitation sent to ${email}`)).toBeVisible();

View File

@@ -28,7 +28,9 @@ test.describe('Members Delete', () => {
'You are the last owner, you cannot be removed from your team.',
),
).toBeVisible();
await expect(page.getByRole('button', { name: 'Validate' })).toBeDisabled();
await expect(
page.getByRole('button', { name: 'Remove from the group' }),
).toBeDisabled();
});
test('it deletes himself when it is not the last owner', async ({
@@ -49,7 +51,7 @@ test.describe('Members Delete', () => {
await cells.nth(4).getByLabel('Member options').click();
await page.getByLabel('Open the modal to delete this member').click();
await page.getByRole('button', { name: 'Validate' }).click();
await page.getByRole('button', { name: 'Remove from the group' }).click();
await expect(
page.getByText(`The member has been removed from the team`),
).toBeVisible();
@@ -76,7 +78,9 @@ test.describe('Members Delete', () => {
await expect(
page.getByText(`You cannot remove other owner.`),
).toBeVisible();
await expect(page.getByRole('button', { name: 'Validate' })).toBeDisabled();
await expect(
page.getByRole('button', { name: 'Remove from the group' }),
).toBeDisabled();
});
test('it deletes admin member', async ({ page, browserName }) => {
@@ -94,7 +98,7 @@ test.describe('Members Delete', () => {
await cells.nth(4).getByLabel('Member options').click();
await page.getByLabel('Open the modal to delete this member').click();
await page.getByRole('button', { name: 'Validate' }).click();
await page.getByRole('button', { name: 'Remove from the group' }).click();
await expect(
page.getByText(`The member has been removed from the team`),
).toBeVisible();
@@ -161,7 +165,7 @@ test.describe('Members Delete', () => {
await cells.nth(4).getByLabel('Member options').click();
await page.getByLabel('Open the modal to delete this member').click();
await page.getByRole('button', { name: 'Validate' }).click();
await page.getByRole('button', { name: 'Remove from the group' }).click();
await expect(
page.getByText(`The member has been removed from the team`),
).toBeVisible();

View File

@@ -16,8 +16,6 @@ test.describe('Team', () => {
await createTeam(page, 'team-top-box', browserName, 1)
).shift();
await expect(page.getByLabel('icon group')).toBeVisible();
await expect(
page.getByRole('heading', {
name: teamName,

View File

@@ -19,8 +19,6 @@ test.describe('Teams Create', () => {
await expect(card.getByLabel('Team name')).toBeVisible();
await expect(card.getByLabel('icon group')).toBeVisible();
await expect(
card.getByRole('heading', {
name: 'Create a new group',