mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-16 23:33:29 +00:00
fix(a11y): name every control by the text it shows
axe 4.14 checks WCAG 2.5.3 (label in name), and the app frame failed it on every page: the account link, the user menu and the day strip carried an aria-label that left out their visible text. The same class sat in the coverage meter, the score ring, medication links, instrument cards, filter pills with a value set, cycle calendar days (named by an ISO key), admin user and login rows, a few sort and action buttons, and the French, Spanish, Italian and Polish weekday chips, whose abbreviations were not part of the day names. Controls with visible text are now named by it, with any extra purpose added as screen-reader text; the select pill and calendar days spell out a name that contains what they show. The day and conversation strips keep their action as the tooltip.
This commit is contained in:
1 parent
038f8b10cd
commit
562ff8a277
36 files changed
+134
-97
No files matched your search
@@ -83,12 +83,12 @@ describe("MeasurementList — filter bar + multi-select chrome", () => {
|
||||
it("renders the filter rail with type, source, date-range and value pills", () => {
|
||||
const html = render("en");
|
||||
expect(html).toContain('data-slot="filter-bar"');
|
||||
expect(html).toContain('aria-label="Type"');
|
||||
expect(html).toContain('aria-label="Source"');
|
||||
expect(html).toContain('aria-label="Date range"');
|
||||
expect(html).toContain(">Type</span>");
|
||||
expect(html).toContain(">Source</span>");
|
||||
expect(html).toContain(">Date range</span>");
|
||||
// v1.18.5 — value-range pill rides the rail for the raw per-sample
|
||||
// list (the default `ALL` type is not a day-grouped/sleep type).
|
||||
expect(html).toContain('aria-label="Value"');
|
||||
expect(html).toContain(">Value</span>");
|
||||
const pills = html.match(/data-slot="filter-bar-pill"/g);
|
||||
expect(pills?.length).toBe(4);
|
||||
});
|
||||
@@ -105,8 +105,8 @@ describe("MeasurementList — filter bar + multi-select chrome", () => {
|
||||
|
||||
it("localises the new chrome in German", () => {
|
||||
const html = render("de");
|
||||
expect(html).toContain('aria-label="Quelle"');
|
||||
expect(html).toContain('aria-label="Zeitraum"');
|
||||
expect(html).toContain(">Quelle</span>");
|
||||
expect(html).toContain(">Zeitraum</span>");
|
||||
expect(html).toContain('aria-label="Alle auf dieser Seite auswählen"');
|
||||
});
|
||||
});
|
||||
@@ -69,7 +69,7 @@ describe("MeasurementList — lockedType", () => {
|
||||
// rail (type pill included); the locked one suppresses the whole
|
||||
// rail (the metric is fixed by the route) and keeps only the count.
|
||||
expect(unlocked).toContain('data-slot="filter-bar"');
|
||||
expect(unlocked).toContain('aria-label="Type"');
|
||||
expect(unlocked).toContain(">Type</span>");
|
||||
expect(locked).not.toContain('data-slot="filter-bar"');
|
||||
expect(locked).not.toContain('role="combobox"');
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user