mirror of
https://github.com/ansible/awx.git
synced 2026-05-06 08:57:35 -02:30
Adds missing mock for fetching the brand name
This commit is contained in:
committed by
Hao Liu
parent
ae0d868681
commit
3636c5e95e
@@ -1,9 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { act } from 'react-dom/test-utils';
|
import { act } from 'react-dom/test-utils';
|
||||||
|
import { DashboardAPI, RootAPI } from 'api';
|
||||||
import { DashboardAPI } from 'api';
|
|
||||||
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
import { mountWithContexts } from '../../../testUtils/enzymeHelpers';
|
||||||
|
|
||||||
import Dashboard from './Dashboard';
|
import Dashboard from './Dashboard';
|
||||||
|
|
||||||
jest.mock('../../api');
|
jest.mock('../../api');
|
||||||
@@ -15,6 +13,11 @@ describe('<Dashboard />', () => {
|
|||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await act(async () => {
|
await act(async () => {
|
||||||
DashboardAPI.read.mockResolvedValue({});
|
DashboardAPI.read.mockResolvedValue({});
|
||||||
|
RootAPI.readAssetVariables.mockResolvedValue({
|
||||||
|
data: {
|
||||||
|
BRAND_NAME: 'AWX',
|
||||||
|
},
|
||||||
|
});
|
||||||
graphRequest = DashboardAPI.readJobGraph;
|
graphRequest = DashboardAPI.readJobGraph;
|
||||||
graphRequest.mockResolvedValue({});
|
graphRequest.mockResolvedValue({});
|
||||||
pageWrapper = mountWithContexts(<Dashboard />);
|
pageWrapper = mountWithContexts(<Dashboard />);
|
||||||
|
|||||||
Reference in New Issue
Block a user