(frontend) set empty alt on logo due to Axe a11y error

image is decorative; alt was redundant with link aria-label

Signed-off-by: Cyril <c.gromoff@gmail.com>
This commit is contained in:
Cyril
2025-10-23 09:17:25 +02:00
parent 9d3c1eb9d5
commit 2f010cf36d
5 changed files with 10 additions and 7 deletions

View File

@@ -159,7 +159,7 @@ test.describe('Header: Override configuration', () => {
logo: {
src: '/assets/logo-gouv.svg',
width: '220px',
alt: 'Gouvernement Logo',
alt: '',
},
},
},
@@ -168,8 +168,11 @@ test.describe('Header: Override configuration', () => {
await page.goto('/');
const header = page.locator('header').first();
await expect(header.getByAltText('Gouvernement Logo')).toBeVisible();
const logoImage = header.getByTestId('header-icon-docs');
await expect(logoImage).toBeVisible();
await expect(header.getByAltText('Docs')).toBeHidden();
await expect(logoImage).not.toHaveAttribute('src', '/assets/icon-docs.svg');
await expect(logoImage).toHaveAttribute('src', '/assets/logo-gouv.svg');
await expect(logoImage).toHaveAttribute('alt', '');
});
});

View File

@@ -68,7 +68,7 @@ export const Header = () => {
className="c__image-system-filter"
data-testid="header-icon-docs"
src={logo?.src || '/assets/icon-docs.svg'}
alt={logo?.alt || t('Docs')}
alt=""
width={0}
height={0}
style={{

View File

@@ -3,6 +3,5 @@ export interface HeaderType {
src?: string;
width?: string;
height?: string;
alt?: string;
};
}