Preferences: Use dashboardUID to set the home dashboard (#51919)

This commit is contained in:
Ivan Ortega Alba
2022-07-22 10:44:22 +02:00
committed by GitHub
parent c7f8c2a7e1
commit 2ec01c8d08
8 changed files with 86 additions and 50 deletions

View File

@@ -35,7 +35,9 @@ const setup = (propOverrides?: object) => {
jest.clearAllMocks();
// needed because SharedPreferences is rendered in the test
jest.spyOn(backendSrv, 'put');
jest.spyOn(backendSrv, 'get').mockResolvedValue({ timezone: 'UTC', homeDashboardId: 0, theme: 'dark' });
jest
.spyOn(backendSrv, 'get')
.mockResolvedValue({ timezone: 'UTC', homeDashboardUID: 'home-dashboard', theme: 'dark' });
jest.spyOn(backendSrv, 'search').mockResolvedValue([]);
const props: Props = {
@@ -70,7 +72,7 @@ describe('Render', () => {
id: 1,
},
preferences: {
homeDashboardId: 1,
homeDashboardUID: 'home-dashboard',
theme: 'Default',
timezone: 'Default',
locale: '',