From a4e37df3d42c410983f82f8a913cddb6fe6c09a5 Mon Sep 17 00:00:00 2001 From: tfhuhtal Date: Wed, 23 Oct 2024 16:48:31 +0300 Subject: [PATCH] fix report page tests --- client/components/Generic/ProgrammeList.js | 6 ++++-- cypress/integration/report.spec.js | 12 +++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/client/components/Generic/ProgrammeList.js b/client/components/Generic/ProgrammeList.js index 22fa3c36..e19943b1 100644 --- a/client/components/Generic/ProgrammeList.js +++ b/client/components/Generic/ProgrammeList.js @@ -52,7 +52,7 @@ const ProgrammeList = ({ programmes, setPicked, picked }) => { return ( - setIsOpen(!isOpen)}> + setIsOpen(!isOpen)}> {t(labels.nowShowing)} @@ -83,7 +83,9 @@ const ProgrammeList = ({ programmes, setPicked, picked }) => { ) })}
-

{t(`${labels.chooseMore}`)}

+

+ {t(`${labels.chooseMore}`)} +

{sortedItems(programmes.all, 'name', lang).map(p => { let pKey = p.key if (form === formKeys.EVALUATION_FACULTIES || form === formKeys.FACULTY_MONITORING) { diff --git a/cypress/integration/report.spec.js b/cypress/integration/report.spec.js index 364dee2d..9a77d1ac 100644 --- a/cypress/integration/report.spec.js +++ b/cypress/integration/report.spec.js @@ -40,6 +40,7 @@ describe('ReportPage tests', () => { cy.reload() cy.wait(1000) cy.get('[data-cy=nav-report]').click() + cy.get('[data-cy=report-select-all-accordion]').click() cy.get('[data-cy=report-select-all]').click() cy.get('[data-cy=report-question-learning_outcomes_text]').should('be.visible').click() cy.get('[data-cy=report-question-content-learning_outcomes_text]').should('contain.text', 'test words') @@ -62,6 +63,7 @@ describe('ReportPage tests', () => { cy.visit('/yearly') cy.get('[data-cy=nav-report]').click() + cy.get('[data-cy=report-select-all-accordion]').click() cy.get('[data-cy=report-select-all]').click() cy.get('[data-cy=report-question-disabled-language_environment_text]').contains('0') }) @@ -73,6 +75,7 @@ describe('ReportPage tests', () => { cy.visit('/yearly') cy.get('[data-cy=nav-report]').click() cy.selectYear(defaultYears[1]) + cy.get('[data-cy=report-select-all-accordion]').click() cy.get('[data-cy=report-select-all]').click() cy.get('[data-cy=report-question-content-teacher_skills_text]').contains(`Hello from ${defaultYears[1]}`) }) @@ -85,6 +88,7 @@ describe('ReportPage tests', () => { cy.selectYear(defaultYears[1]) cy.get('[data-cy=master-filter]').should('be.visible').click() + cy.get('[data-cy=report-select-all-accordion]').click() cy.get('[data-cy=report-select-all]').should('contain', 'all') cy.get('[data-cy=report-select-all]').click() cy.get('[data-cy=answered-label-language_environment_text]').contains('/ 64') @@ -99,6 +103,8 @@ describe('ReportPage tests', () => { cy.get('[data-cy=faculty-filter]').click() cy.wait(1000) cy.get('[data-cy=faculty-filter]').contains('Faculty of Law').should('be.visible').click() + cy.get('[data-cy=faculty-filter]').click() + cy.get('[data-cy=report-select-all-accordion]').click() cy.get('[data-cy=report-list-programme-KH20_001]').should('be.visible') cy.get('[data-cy=report-list-programme-MH20_003]').should('be.visible') cy.get('[data-cy=report-list-programme-MH20_001]').should('be.visible') @@ -112,11 +118,12 @@ describe('ReportPage tests', () => { cy.visit('/yearly') cy.get('[data-cy=nav-report]').click() cy.get('[data-cy=doctoral-school-filter]').should('not.exist') - cy.get('[data-cy=doctoral-filter]') + cy.get('[data-cy=doctoral-filter]').click() cy.wait(1000) cy.get('[data-cy=doctoral-school-filter]').click() cy.get('span').contains('Doctoral school in natural sciences').should('be.visible').click() + cy.get('[data-cy=report-select-all-accordion]').click() cy.get('[data-cy=report-list-programme-T923104]').should('be.visible') cy.get('[data-cy=report-list-programme-T923107]').should('be.visible') cy.get('[data-cy=report-list-programme-T922104]').should('not.exist') @@ -130,9 +137,11 @@ describe('ReportPage tests', () => { cy.get('[data-cy=companion-filter]').should('not.exist') cy.get('[data-cy=faculty-filter]').should('be.visible').click() cy.get('span').contains('Faculty of Arts').should('be.visible').click() + cy.get('[data-cy=faculty-filter]').click() cy.get('[data-cy=doctoral-filter]').should('be.visible').click() cy.get('[data-cy=companion-filter]').should('be.visible') cy.get('[data-cy=companion-filter]').click() + cy.get('[data-cy=report-select-all-accordion]').click() // Companion programmes cy.get('[data-cy=report-list-programme-T921107]').should('be.visible') cy.get('[data-cy=report-list-programme-T923102]').should('be.visible') @@ -155,6 +164,7 @@ describe('ReportPage tests', () => { cy.get('[data-cy=color-negative-review_of_last_years_situation_report]').click() cy.visit('/yearly') cy.get('[data-cy=nav-report]').click() + cy.get('[data-cy=report-select-all-accordion]').click() cy.get('[data-cy=report-select-all]').click() cy.get('div').contains('lights').should('be.visible').click() cy.get('[data-cy=report-chart-review_of_last_years_situation_report_text]')