Skip to content

Commit

Permalink
Display job title on PostAJob Preview
Browse files Browse the repository at this point in the history
  • Loading branch information
forresthayes committed Jul 24, 2020
1 parent f176037 commit 52cac47
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 2 additions & 2 deletions cypress/integration/components/post_a_job_form_spec.js
Expand Up @@ -6,7 +6,7 @@ describe('post a job form', () => {
it('tests the form exists with all expected fields', () => {
cy.get("[data-cy='status-bar']>svg>circle").first().should('not.have.attr', 'fill-opacity')
cy.get("[data-cy='post-a-job-form']")
cy.get('input[name="jobTitle"]')
cy.get('input[name="jobtitle"]')
cy.get('select[name="roleFocus"]')
cy.get('select[name="positionType"]')
// Quill Input
Expand All @@ -25,7 +25,7 @@ describe('post a job form', () => {
cy.get('.input-error').should('have.length', 10)
})
it('tests inputs all the form fields', () => {
cy.get('input[name="jobTitle"]').type('Junior Developer').should('value', 'Junior Developer')
cy.get('input[name="jobtitle"]').type('Junior Developer').should('value', 'Junior Developer')
cy.get('select[name="roleFocus"]').select('Front-end').should('value', 'Front-end')
cy.get('select[name="positionType"]').select('Full-time').should('value', 'Full-time')
// Quill Input
Expand Down
10 changes: 4 additions & 6 deletions src/components/form/PostAJobForm.js
Expand Up @@ -16,8 +16,6 @@ const PostAJobForm = ({
}) => {
const [fileValue, setFileValue] = useState(undefined)

console.log(jobData)

function recievingLogo(logo) {
setFileValue(logo)
recievingLogo2(logo)
Expand All @@ -27,7 +25,7 @@ const PostAJobForm = ({
<div className='lg:w-3/5 mx-auto'>
<Formik
initialValues={{
jobTitle: jobData ? `${jobData.jobTitle}` : '',
jobtitle: jobData ? `${jobData.jobtitle}` : '',
roleFocus: jobData ? `${jobData.roleFocus}` : '',
positionType: jobData ? `${jobData.positionType}` : '',
jobDescription: jobData ? `${jobData.jobDescription}` : '',
Expand All @@ -40,7 +38,7 @@ const PostAJobForm = ({
companyHQ: jobData ? `${jobData.companyHQ}` : '',
}}
validationSchema={Yup.object({
jobTitle: Yup.string().required('Job title is a required field.'),
jobtitle: Yup.string().required('Job title is a required field.'),
roleFocus: Yup.string().required('Please select a focus area.'),
positionType: Yup.string().required('Please select a position type.'),
jobDescription: Yup.string().required(
Expand Down Expand Up @@ -87,14 +85,14 @@ const PostAJobForm = ({

<Field
id='job-title'
name='jobTitle'
name='jobtitle'
className='input'
type='text'
autoComplete='off'
></Field>

<ErrorMessage
name='jobTitle'
name='jobtitle'
component='span'
className='input-error'
/>
Expand Down

0 comments on commit 52cac47

Please sign in to comment.