From b06421b8709409a4dbd97ea41d5a9ca3147b20b9 Mon Sep 17 00:00:00 2001 From: Marliana Lara Date: Thu, 27 Jun 2019 11:46:52 -0400 Subject: [PATCH] Rename TemplateForm to JobTemplateForm --- .../Template/JobTemplateEdit/JobTemplateEdit.jsx | 4 ++-- .../JobTemplateEdit/JobTemplateEdit.test.jsx | 2 +- .../shared/{TemplateForm.jsx => JobTemplateForm.jsx} | 4 ++-- ...emplateForm.test.jsx => JobTemplateForm.test.jsx} | 12 ++++++------ awx/ui_next/src/screens/Template/shared/index.js | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) rename awx/ui_next/src/screens/Template/shared/{TemplateForm.jsx => JobTemplateForm.jsx} (97%) rename awx/ui_next/src/screens/Template/shared/{TemplateForm.test.jsx => JobTemplateForm.test.jsx} (94%) diff --git a/awx/ui_next/src/screens/Template/JobTemplateEdit/JobTemplateEdit.jsx b/awx/ui_next/src/screens/Template/JobTemplateEdit/JobTemplateEdit.jsx index 494adf0569..c488b3c8f6 100644 --- a/awx/ui_next/src/screens/Template/JobTemplateEdit/JobTemplateEdit.jsx +++ b/awx/ui_next/src/screens/Template/JobTemplateEdit/JobTemplateEdit.jsx @@ -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 ( - ', () => { job_type: 'check', }; - wrapper.find('TemplateForm').prop('handleSubmit')(updatedTemplateData); + wrapper.find('JobTemplateForm').prop('handleSubmit')(updatedTemplateData); expect(JobTemplatesAPI.update).toHaveBeenCalledWith(1, updatedTemplateData); }); diff --git a/awx/ui_next/src/screens/Template/shared/TemplateForm.jsx b/awx/ui_next/src/screens/Template/shared/JobTemplateForm.jsx similarity index 97% rename from awx/ui_next/src/screens/Template/shared/TemplateForm.jsx rename to awx/ui_next/src/screens/Template/shared/JobTemplateForm.jsx index e7d91a544a..536cf486e5 100644 --- a/awx/ui_next/src/screens/Template/shared/TemplateForm.jsx +++ b/awx/ui_next/src/screens/Template/shared/JobTemplateForm.jsx @@ -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)); diff --git a/awx/ui_next/src/screens/Template/shared/TemplateForm.test.jsx b/awx/ui_next/src/screens/Template/shared/JobTemplateForm.test.jsx similarity index 94% rename from awx/ui_next/src/screens/Template/shared/TemplateForm.test.jsx rename to awx/ui_next/src/screens/Template/shared/JobTemplateForm.test.jsx index 1c6e68d22c..653cb52a41 100644 --- a/awx/ui_next/src/screens/Template/shared/TemplateForm.test.jsx +++ b/awx/ui_next/src/screens/Template/shared/JobTemplateForm.test.jsx @@ -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('', () => { +describe('', () => { const mockData = { id: 1, name: 'Foo', @@ -23,7 +23,7 @@ describe('', () => { test('initially renders successfully', () => { mountWithContexts( - ', () => { test('should update form values on input changes', () => { const wrapper = mountWithContexts( - ', () => { test('should call handleSubmit when Submit button is clicked', async () => { const handleSubmit = jest.fn(); const wrapper = mountWithContexts( - ', () => { test('should call handleCancel when Cancel button is clicked', () => { const handleCancel = jest.fn(); const wrapper = mountWithContexts( -