mirror of
https://github.com/ansible/awx.git
synced 2026-05-17 06:17:36 -02:30
Fixes bug with workflow form test throwing warning about Failed prop type: The prop value.name is marked as required in OrganizationLookup, but its value is undefined
This commit is contained in:
@@ -13,9 +13,18 @@ import {
|
|||||||
InventoriesAPI,
|
InventoriesAPI,
|
||||||
ProjectsAPI,
|
ProjectsAPI,
|
||||||
CredentialTypesAPI,
|
CredentialTypesAPI,
|
||||||
|
ExecutionEnvironmentsAPI,
|
||||||
|
CredentialsAPI,
|
||||||
} from '../../../api';
|
} from '../../../api';
|
||||||
|
|
||||||
jest.mock('../../../api');
|
jest.mock('../../../api/models/ExecutionEnvironments');
|
||||||
|
jest.mock('../../../api/models/WorkflowJobTemplates');
|
||||||
|
jest.mock('../../../api/models/Labels');
|
||||||
|
jest.mock('../../../api/models/Organizations');
|
||||||
|
jest.mock('../../../api/models/Inventories');
|
||||||
|
jest.mock('../../../api/models/Projects');
|
||||||
|
jest.mock('../../../api/models/CredentialTypes');
|
||||||
|
jest.mock('../../../api/models/Credentials');
|
||||||
|
|
||||||
describe('<WorkflowJobTemplateForm/>', () => {
|
describe('<WorkflowJobTemplateForm/>', () => {
|
||||||
let wrapper;
|
let wrapper;
|
||||||
@@ -61,7 +70,12 @@ describe('<WorkflowJobTemplateForm/>', () => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
OrganizationsAPI.read.mockResolvedValue({
|
OrganizationsAPI.read.mockResolvedValue({
|
||||||
results: [{ id: 1 }, { id: 2 }],
|
data: {
|
||||||
|
results: [
|
||||||
|
{ id: 1, name: 'Organization 1' },
|
||||||
|
{ id: 2, name: 'Organization 2' },
|
||||||
|
],
|
||||||
|
},
|
||||||
});
|
});
|
||||||
InventoriesAPI.read.mockResolvedValue({
|
InventoriesAPI.read.mockResolvedValue({
|
||||||
results: [
|
results: [
|
||||||
@@ -78,6 +92,18 @@ describe('<WorkflowJobTemplateForm/>', () => {
|
|||||||
ProjectsAPI.readOptions.mockResolvedValue({
|
ProjectsAPI.readOptions.mockResolvedValue({
|
||||||
data: { actions: { GET: {}, POST: {} } },
|
data: { actions: { GET: {}, POST: {} } },
|
||||||
});
|
});
|
||||||
|
ExecutionEnvironmentsAPI.read.mockResolvedValue({
|
||||||
|
data: { results: [] },
|
||||||
|
});
|
||||||
|
ExecutionEnvironmentsAPI.readOptions.mockResolvedValue({
|
||||||
|
data: { actions: { GET: {}, POST: {} } },
|
||||||
|
});
|
||||||
|
CredentialsAPI.read.mockResolvedValue({
|
||||||
|
data: { results: [] },
|
||||||
|
});
|
||||||
|
CredentialsAPI.readOptions.mockResolvedValue({
|
||||||
|
data: { actions: { GET: {}, POST: {} } },
|
||||||
|
});
|
||||||
|
|
||||||
history = createMemoryHistory({
|
history = createMemoryHistory({
|
||||||
initialEntries: ['/templates/workflow_job_template/6/edit'],
|
initialEntries: ['/templates/workflow_job_template/6/edit'],
|
||||||
|
|||||||
Reference in New Issue
Block a user