Skip to content

The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:

Add aria-level attribute to dashboard title heading (#70985)

Anderson832e71aa4624
diff --git a/frontend/src/metabase/dashboard/components/DashboardHeader/DashboardHeaderView.tsx b/frontend/src/metabase/dashboard/components/DashboardHeader/DashboardHeaderView.tsx
index faac2e758a1..3c1d05410a6 100644
--- a/frontend/src/metabase/dashboard/components/DashboardHeader/DashboardHeaderView.tsx
+++ b/frontend/src/metabase/dashboard/components/DashboardHeader/DashboardHeaderView.tsx
@@ -133,6 +133,7 @@ export function DashboardHeaderView({
{titled && (
<Box
role="heading"
+ aria-level={1}
className={cx(S.HeaderContent, {
[S.showSubHeader]: showSubHeader,
})}
diff --git a/frontend/src/metabase/dashboard/components/DashboardHeader/tests/enterprise.unit.spec.ts b/frontend/src/metabase/dashboard/components/DashboardHeader/tests/enterprise.unit.spec.ts
index ca52ea79096..dc0d6079482 100644
--- a/frontend/src/metabase/dashboard/components/DashboardHeader/tests/enterprise.unit.spec.ts
+++ b/frontend/src/metabase/dashboard/components/DashboardHeader/tests/enterprise.unit.spec.ts
@@ -34,6 +34,14 @@ describe("DashboardHeader - enterprise", () => {
dashboard: INSTANCE_ANALYTICS_DASHBOARD,
collections: [INSTANCE_ANALYTICS_COLLECTION],
});
+
+ // Expect heading element to be present with correct role and aria-level (#70544)
+ expect(
+ await screen.findByRole("heading", {
+ level: 1,
+ name: /Analytics Dashboard/,
+ }),
+ ).toBeInTheDocument();
expect(
await screen.findByRole("img", { name: /audit/i }),
).toBeInTheDocument();