(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

@@ -21,6 +21,8 @@ and this project adheres to
- 🐛(frontend) fix duplicate document entries in grid #1479 - 🐛(frontend) fix duplicate document entries in grid #1479
- 🐛(frontend) show full nested doc names with ajustable bar #1456 - 🐛(frontend) show full nested doc names with ajustable bar #1456
- 🐛(backend) fix trashbin list - 🐛(backend) fix trashbin list
- ♿(frontend) improve accessibility:
- ♿(frontend) remove empty alt on logo due to Axe a11y error #1516
## [3.8.2] - 2025-10-17 ## [3.8.2] - 2025-10-17

View File

@@ -159,7 +159,7 @@ test.describe('Header: Override configuration', () => {
logo: { logo: {
src: '/assets/logo-gouv.svg', src: '/assets/logo-gouv.svg',
width: '220px', width: '220px',
alt: 'Gouvernement Logo', alt: '',
}, },
}, },
}, },
@@ -168,8 +168,11 @@ test.describe('Header: Override configuration', () => {
await page.goto('/'); await page.goto('/');
const header = page.locator('header').first(); 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" className="c__image-system-filter"
data-testid="header-icon-docs" data-testid="header-icon-docs"
src={logo?.src || '/assets/icon-docs.svg'} src={logo?.src || '/assets/icon-docs.svg'}
alt={logo?.alt || t('Docs')} alt=""
width={0} width={0}
height={0} height={0}
style={{ style={{

View File

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

View File

@@ -137,8 +137,7 @@
"header": { "header": {
"logo": { "logo": {
"src": "/assets/icon-docs.svg", "src": "/assets/icon-docs.svg",
"width": "32px", "width": "32px"
"alt": "Notes"
} }
} }
} }