Skip to content

Commit deff2fe

Browse files
committed
✨(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 <[email protected]>
1 parent dd56a8a commit deff2fe

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ and this project adheres to
1616
- 🐛(frontend) fix duplicate document entries in grid #1479
1717
- 🐛(frontend) show full nested doc names with ajustable bar #1456
1818
- 🐛(backend) fix trashbin list
19+
- ♿(frontend) improve accessibility:
20+
- ♿(frontend) remove empty alt on logo due to Axe a11y error #1516
1921

2022
## [3.8.2] - 2025-10-17
2123

src/frontend/apps/e2e/__tests__/app-impress/header.spec.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ test.describe('Header: Override configuration', () => {
159159
logo: {
160160
src: '/assets/logo-gouv.svg',
161161
width: '220px',
162-
alt: 'Gouvernement Logo',
162+
alt: '',
163163
},
164164
},
165165
},
@@ -168,8 +168,11 @@ test.describe('Header: Override configuration', () => {
168168
await page.goto('/');
169169
const header = page.locator('header').first();
170170

171-
await expect(header.getByAltText('Gouvernement Logo')).toBeVisible();
171+
const logoImage = header.getByTestId('header-icon-docs');
172+
await expect(logoImage).toBeVisible();
172173

173-
await expect(header.getByAltText('Docs')).toBeHidden();
174+
await expect(logoImage).not.toHaveAttribute('src', '/assets/icon-docs.svg');
175+
await expect(logoImage).toHaveAttribute('src', '/assets/logo-gouv.svg');
176+
await expect(logoImage).toHaveAttribute('alt', '');
174177
});
175178
});

src/frontend/apps/impress/src/features/header/components/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export const Header = () => {
6868
className="c__image-system-filter"
6969
data-testid="header-icon-docs"
7070
src={logo?.src || '/assets/icon-docs.svg'}
71-
alt={logo?.alt || t('Docs')}
71+
alt=""
7272
width={0}
7373
height={0}
7474
style={{

src/frontend/apps/impress/src/features/header/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@ export interface HeaderType {
33
src?: string;
44
width?: string;
55
height?: string;
6-
alt?: string;
76
};
87
}

src/helm/env.d/dev/configuration/theme/demo.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@
137137
"header": {
138138
"logo": {
139139
"src": "/assets/icon-docs.svg",
140-
"width": "32px",
141-
"alt": "Notes"
140+
"width": "32px"
142141
}
143142
}
144143
}

0 commit comments

Comments
 (0)