Skip to content

Commit 7440cc4

Browse files
sadpandajoeclaude
andcommitted
fix(dashboard): render the displayed (localized) title in the page heading
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
1 parent ddcfe71 commit 7440cc4

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎superset-frontend/src/dashboard/components/Header/Header.test.tsx‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,10 @@ test('shows the localized title while it still names the current title', () => {
14451445
},
14461446
});
14471447

1448-
expect(screen.getByText('Tableau de bord')).toBeInTheDocument();
1448+
expect(screen.getAllByText('Tableau de bord').length).toBeGreaterThan(0);
1449+
expect(
1450+
screen.getByRole('heading', { level: 1, name: 'Tableau de bord' }),
1451+
).toBeInTheDocument();
14491452
expect(screen.queryByText('Dashboard Title')).not.toBeInTheDocument();
14501453
});
14511454

@@ -1461,7 +1464,9 @@ test('falls back to the canonical title once a rename outdates the translation',
14611464
},
14621465
});
14631466

1464-
expect(screen.getByText('Dashboard Title')).toBeInTheDocument();
1467+
expect(
1468+
screen.getByRole('heading', { level: 1, name: 'Dashboard Title' }),
1469+
).toBeInTheDocument();
14651470
expect(screen.queryByText('Tableau de bord')).not.toBeInTheDocument();
14661471
});
14671472

‎superset-frontend/src/dashboard/components/Header/index.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ const Header = ({ onOpenMobileFilters }: HeaderComponentProps): JSX.Element => {
883883
className="dashboard-header-container"
884884
>
885885
<VisuallyHidden as="h1">
886-
{dashboardTitle || t('Dashboard')}
886+
{editableTitleProps.title || t('Dashboard')}
887887
</VisuallyHidden>
888888
<PageHeaderWithActions
889889
editableTitleProps={editableTitleProps}

0 commit comments

Comments
 (0)