mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 11:20:39 -03:30
Fix unit tests.
This commit is contained in:
parent
6e87b29e92
commit
a133a14b70
@ -30,11 +30,11 @@ import { LaunchButton } from 'components/LaunchButton';
|
||||
import { VariablesDetail } from 'components/CodeEditor';
|
||||
import { JobTemplatesAPI } from 'api';
|
||||
import useRequest, { useDismissableError } from 'hooks/useRequest';
|
||||
import useBrandName from 'hooks/useBrandName';
|
||||
import ExecutionEnvironmentDetail from 'components/ExecutionEnvironmentDetail';
|
||||
import { relatedResourceDeleteRequests } from 'util/getRelatedResourceDeleteDetails';
|
||||
import jtHelpTextStrings from '../shared/JobTemplate.helptext';
|
||||
|
||||
const helpText = jtHelpTextStrings();
|
||||
function JobTemplateDetail({ template }) {
|
||||
const {
|
||||
ask_inventory_on_launch,
|
||||
@ -66,6 +66,8 @@ function JobTemplateDetail({ template }) {
|
||||
} = template;
|
||||
const { id: templateId } = useParams();
|
||||
const history = useHistory();
|
||||
const brandName = useBrandName();
|
||||
const helpText = jtHelpTextStrings(brandName);
|
||||
|
||||
const {
|
||||
isLoading: isLoadingInstanceGroups,
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { JobTemplatesAPI, WorkflowJobTemplateNodesAPI } from 'api';
|
||||
import { JobTemplatesAPI, WorkflowJobTemplateNodesAPI, RootAPI } from 'api';
|
||||
import {
|
||||
mountWithContexts,
|
||||
waitForElement,
|
||||
@ -26,6 +26,11 @@ describe('<JobTemplateDetail />', () => {
|
||||
beforeEach(async () => {
|
||||
JobTemplatesAPI.readInstanceGroups.mockResolvedValue(mockInstanceGroups);
|
||||
WorkflowJobTemplateNodesAPI.read.mockResolvedValue({ data: { count: 0 } });
|
||||
RootAPI.readAssetVariables.mockResolvedValue({
|
||||
data: {
|
||||
BRAND_NAME: 'AWX',
|
||||
},
|
||||
});
|
||||
await act(async () => {
|
||||
wrapper = mountWithContexts(
|
||||
<JobTemplateDetail template={mockTemplate} />
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user