From 594cc14486367663472a41f9f1fc32f3b3d8038f Mon Sep 17 00:00:00 2001 From: Henri Remonen Date: Fri, 10 Feb 2023 12:46:04 +0200 Subject: [PATCH] Modify testing to take into account the button for proceeding to the questions! --- cypress/e2e/spec.cy.ts | 8 ++++++++ .../components/InteractiveForm/RenderSurvey.tsx | 11 +++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/spec.cy.ts b/cypress/e2e/spec.cy.ts index 899965b5..4e8a30dc 100644 --- a/cypress/e2e/spec.cy.ts +++ b/cypress/e2e/spec.cy.ts @@ -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) => { diff --git a/src/client/components/InteractiveForm/RenderSurvey.tsx b/src/client/components/InteractiveForm/RenderSurvey.tsx index 419250ea..c0a8a610 100644 --- a/src/client/components/InteractiveForm/RenderSurvey.tsx +++ b/src/client/components/InteractiveForm/RenderSurvey.tsx @@ -48,12 +48,19 @@ const RenderSurvey: React.FC< ))} {!showQuestions && ( - )} - {showQuestions && } + {showQuestions && ( + + )} )