diff --git a/public/app/features/dashboard-scene/pages/DashboardScenePage.test.tsx b/public/app/features/dashboard-scene/pages/DashboardScenePage.test.tsx index e7524d1ceeb..11146de7f4d 100644 --- a/public/app/features/dashboard-scene/pages/DashboardScenePage.test.tsx +++ b/public/app/features/dashboard-scene/pages/DashboardScenePage.test.tsx @@ -220,7 +220,7 @@ describe('DashboardScenePage', () => { describe('empty state', () => { it('Shows empty state when dashboard is empty', async () => { - loadDashboardMock.mockResolvedValue({ dashboard: { panels: [] }, meta: {} }); + loadDashboardMock.mockResolvedValue({ dashboard: { uid: 'my-dash-uid', panels: [] }, meta: {} }); setup(); expect(await screen.findByText('Start your new dashboard by adding a visualization')).toBeInTheDocument(); @@ -299,7 +299,7 @@ describe('DashboardScenePage', () => { it('should show controls', async () => { getDashboardScenePageStateManager().clearDashboardCache(); loadDashboardMock.mockClear(); - loadDashboardMock.mockResolvedValue({ dashboard: { panels: [] }, meta: {} }); + loadDashboardMock.mockResolvedValue({ dashboard: { uid: 'my-dash-uid', panels: [] }, meta: {} }); setup(); diff --git a/public/app/features/dashboard-scene/pages/DashboardScenePage.tsx b/public/app/features/dashboard-scene/pages/DashboardScenePage.tsx index 2a368ffd91f..9d004d346f1 100644 --- a/public/app/features/dashboard-scene/pages/DashboardScenePage.tsx +++ b/public/app/features/dashboard-scene/pages/DashboardScenePage.tsx @@ -78,7 +78,7 @@ export function DashboardScenePage({ match, route, queryParams, history }: Props // Do not render anything when transitioning from one dashboard to another if ( match.params.type !== 'snapshot' && - dashboard.state.uid && + match.params.uid && dashboard.state.uid !== match.params.uid && route.routeName !== DashboardRoutes.Home ) {