mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 03:10:42 -03:30
Rename TemplateForm to JobTemplateForm
This commit is contained in:
parent
d4f50896de
commit
b06421b870
@ -1,7 +1,7 @@
|
||||
import React, { Component } from 'react';
|
||||
import { withRouter, Redirect } from 'react-router-dom';
|
||||
import { CardBody } from '@patternfly/react-core';
|
||||
import TemplateForm from '../shared/TemplateForm';
|
||||
import JobTemplateForm from '../shared/JobTemplateForm';
|
||||
import { JobTemplatesAPI } from '@api';
|
||||
import { JobTemplate } from '@types';
|
||||
|
||||
@ -57,7 +57,7 @@ class JobTemplateEdit extends Component {
|
||||
|
||||
return (
|
||||
<CardBody>
|
||||
<TemplateForm
|
||||
<JobTemplateForm
|
||||
template={template}
|
||||
handleCancel={this.handleCancel}
|
||||
handleSubmit={this.handleSubmit}
|
||||
|
||||
@ -34,7 +34,7 @@ describe('<JobTemplateEdit />', () => {
|
||||
job_type: 'check',
|
||||
};
|
||||
|
||||
wrapper.find('TemplateForm').prop('handleSubmit')(updatedTemplateData);
|
||||
wrapper.find('JobTemplateForm').prop('handleSubmit')(updatedTemplateData);
|
||||
expect(JobTemplatesAPI.update).toHaveBeenCalledWith(1, updatedTemplateData);
|
||||
});
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ const QuestionCircleIcon = styled(PFQuestionCircleIcon)`
|
||||
margin-left: 10px;
|
||||
`;
|
||||
|
||||
class TemplateForm extends Component {
|
||||
class JobTemplateForm extends Component {
|
||||
static propTypes = {
|
||||
template: JobTemplate.isRequired,
|
||||
handleCancel: PropTypes.func.isRequired,
|
||||
@ -137,4 +137,4 @@ class TemplateForm extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
export default withI18n()(withRouter(TemplateForm));
|
||||
export default withI18n()(withRouter(JobTemplateForm));
|
||||
@ -1,11 +1,11 @@
|
||||
import React from 'react';
|
||||
import { mountWithContexts } from '@testUtils/enzymeHelpers';
|
||||
import { sleep } from '@testUtils/testUtils';
|
||||
import TemplateForm from './TemplateForm';
|
||||
import JobTemplateForm from './JobTemplateForm';
|
||||
|
||||
jest.mock('@api');
|
||||
|
||||
describe('<TemplateForm />', () => {
|
||||
describe('<JobTemplateForm />', () => {
|
||||
const mockData = {
|
||||
id: 1,
|
||||
name: 'Foo',
|
||||
@ -23,7 +23,7 @@ describe('<TemplateForm />', () => {
|
||||
|
||||
test('initially renders successfully', () => {
|
||||
mountWithContexts(
|
||||
<TemplateForm
|
||||
<JobTemplateForm
|
||||
template={mockData}
|
||||
handleSubmit={jest.fn()}
|
||||
handleCancel={jest.fn()}
|
||||
@ -33,7 +33,7 @@ describe('<TemplateForm />', () => {
|
||||
|
||||
test('should update form values on input changes', () => {
|
||||
const wrapper = mountWithContexts(
|
||||
<TemplateForm
|
||||
<JobTemplateForm
|
||||
template={mockData}
|
||||
handleSubmit={jest.fn()}
|
||||
handleCancel={jest.fn()}
|
||||
@ -70,7 +70,7 @@ describe('<TemplateForm />', () => {
|
||||
test('should call handleSubmit when Submit button is clicked', async () => {
|
||||
const handleSubmit = jest.fn();
|
||||
const wrapper = mountWithContexts(
|
||||
<TemplateForm
|
||||
<JobTemplateForm
|
||||
template={mockData}
|
||||
handleSubmit={handleSubmit}
|
||||
handleCancel={jest.fn()}
|
||||
@ -86,7 +86,7 @@ describe('<TemplateForm />', () => {
|
||||
test('should call handleCancel when Cancel button is clicked', () => {
|
||||
const handleCancel = jest.fn();
|
||||
const wrapper = mountWithContexts(
|
||||
<TemplateForm
|
||||
<JobTemplateForm
|
||||
template={mockData}
|
||||
handleSubmit={jest.fn()}
|
||||
handleCancel={handleCancel}
|
||||
@ -1 +1 @@
|
||||
export { default } from './TemplateForm';
|
||||
export { default } from './JobTemplateForm';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user