Adds missing mock for fetching the brand name

This commit is contained in:
Michael Abashian
2023-03-16 23:37:30 -04:00
committed by Hao Liu
parent ae0d868681
commit 3636c5e95e
@@ -1,9 +1,7 @@
import React from 'react';
import { act } from 'react-dom/test-utils';
import { DashboardAPI } from 'api';
import { DashboardAPI, RootAPI } from 'api';
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
import Dashboard from './Dashboard';
jest.mock('../../api');
@@ -15,6 +13,11 @@ describe('<Dashboard />', () => {
beforeEach(async () => {
await act(async () => {
DashboardAPI.read.mockResolvedValue({});
RootAPI.readAssetVariables.mockResolvedValue({
data: {
BRAND_NAME: 'AWX',
},
});
graphRequest = DashboardAPI.readJobGraph;
graphRequest.mockResolvedValue({});
pageWrapper = mountWithContexts(<Dashboard />);