diff --git a/src/components/admin/__tests__/encryption-legacy-badge.test.tsx b/src/components/admin/__tests__/encryption-legacy-badge.test.tsx index 07c461003..055ac5f63 100644 --- a/src/components/admin/__tests__/encryption-legacy-badge.test.tsx +++ b/src/components/admin/__tests__/encryption-legacy-badge.test.tsx @@ -131,6 +131,12 @@ describe("encryption coverage — the per-column table", () => { expect(html).not.toContain('data-slot="encryption-column-rows"'); }); + it("keeps the toggle's aria-controls target in the tree while collapsed", () => { + const html = renderCoverage(false); + expect(html).toContain('aria-controls="encryption-columns-panel"'); + expect(html).toMatch(/
- {t("admin.section.encryption.columnsNoneWithRows")} -
- ) : ( - /* Focusable, named scroll region: on a phone the table scrolls + {/* The panel stays in the tree, empty and hidden, while closed, so + the toggle's aria-controls always names an element. */} ++ {t("admin.section.encryption.columnsNoneWithRows")} +
+ ) : ( + /* Focusable, named scroll region: on a phone the table scrolls sideways, and a keyboard user has to be able to reach it (axe scrollable-region-focusable). */ -| - {t("admin.section.encryption.colColumn")} - | -- {t("admin.section.encryption.colTotal")} - | -- {t("admin.section.encryption.colActive")} - | -- {t("admin.section.encryption.colStale")} - | -
|---|---|---|---|
| - {c.model}.{c.field} - | -- {c.total.toLocaleString()} - | -{active.toLocaleString()} | -
- {stale > 0 ? (
- |
-
| + {t("admin.section.encryption.colColumn")} + | ++ {t("admin.section.encryption.colTotal")} + | ++ {t("admin.section.encryption.colActive")} + | ++ {t("admin.section.encryption.colStale")} + | +
|---|---|---|---|
| + {c.model}.{c.field} + | ++ {c.total.toLocaleString()} + | ++ {active.toLocaleString()} + | +
+ {stale > 0 ? (
+ |
+
- {t("settings.sections.sources.perMetricHelp")} -
- {overriddenMetrics.length === 0 ? ( -- {t("settings.sections.sources.deviceTypeHelp")} -
-+ {t("settings.sections.sources.deviceTypeHelp")} +
+