Skip to content

Commit 4107d49

Browse files
committed
Backfill test for Employer selection
1 parent d814d66 commit 4107d49

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

e2e/integration/journey.test.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,35 @@ it('can submit a minimal form', () => {
5757
})
5858
})
5959
})
60+
61+
it('requires employee selection', () => {
62+
cy.findByRole('textbox', { name: /first name/i }).type('Laura')
63+
cy.findByRole('textbox', { name: /last name/i }).type('Olsen')
64+
cy.findByRole('combobox', { name: /city/i }).select('London')
65+
cy.findByRole('textbox', { name: /email/i }).type('[email protected]')
66+
cy.findByRole('textbox', { name: /phone number/i }).type('96838503')
67+
cy.findByRole('textbox', { name: /interested in volunteering/i }).type('just')
68+
cy.findByRole('textbox', { name: /interested in code your future/i }).type(
69+
'testing'
70+
)
71+
cy.findByRole('checkbox', { name: /terms of use/i }).check()
72+
cy.findByRole('checkbox', { name: /contact me/i }).check()
73+
74+
cy.findByRole('combobox', { name: /hear about code your future/i }).select(
75+
'Employer'
76+
)
77+
cy.findByRole('button', { name: /submit/i }).click()
78+
cy.findByText(/form is incomplete/i).should('exist')
79+
80+
cy.findByRole('combobox', { name: /who is your employer/i }).select(
81+
'Capgemini'
82+
)
83+
cy.findByRole('button', { name: /submit/i }).click()
84+
85+
cy.request(`${mockServerURL}/_calls`).then(({ body }) => {
86+
expect(body).to.have.length(1)
87+
const [{ body: payload }] = body
88+
expect(payload).to.have.property('hearAboutCYF', 'Employer')
89+
expect(payload).to.have.property('employer', 'Capgemini')
90+
})
91+
})

0 commit comments

Comments
 (0)