Skip to content

Commit

Permalink
Modify testing to take into account the button for proceeding to the …
Browse files Browse the repository at this point in the history
…questions!
  • Loading branch information
HRemonen committed Feb 10, 2023
1 parent 3f1caf1 commit 594cc14
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
8 changes: 8 additions & 0 deletions cypress/e2e/spec.cy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,17 @@ describe('Kliksutin web page', () => {
cy.contains('Kliksutin')
})

it('user must proceed after faculty and dimensions are selected', () => {
cy.visit(baseUrl)

cy.get('#open-form-button')
})

it('loads visible questions correctly', () => {
cy.visit(baseUrl)

cy.get('#open-form-button').click()

questionData = getQuestionData()

cy.wrap(questionData).each((question: Question) => {
Expand Down
11 changes: 9 additions & 2 deletions src/client/components/InteractiveForm/RenderSurvey.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,19 @@ const RenderSurvey: React.FC<
))}
{!showQuestions && (
<Box textAlign="center">
<Button onClick={() => setShowQuestions(true)}>
<Button
id="open-form-button"
onClick={() => setShowQuestions(true)}
>
{t('openForm')}
</Button>
</Box>
)}
{showQuestions && <Button onClick={handleSubmit}>{t('submit')}</Button>}
{showQuestions && (
<Button id="submit-form-button" onClick={handleSubmit}>
{t('submit')}
</Button>
)}
</Box>
</Box>
)
Expand Down

0 comments on commit 594cc14

Please sign in to comment.