From c35c4d9dfdba3f9a8275fb8e9ee7dd5c734471f9 Mon Sep 17 00:00:00 2001 From: tfhuhtal Date: Mon, 2 Dec 2024 19:13:19 +0200 Subject: [PATCH] fix: stuff was broken --- cypress/integration/facultymonitoringoverview.spec.js | 6 +++--- cypress/integration/homepage.spec.js | 6 ++++-- cypress/integration/metaevaluation.spec.js | 9 +++++---- cypress/integration/trackingpage.spec.js | 6 +++--- server/scripts/draftAndFinalAnswers.js | 4 ++-- 5 files changed, 17 insertions(+), 14 deletions(-) diff --git a/cypress/integration/facultymonitoringoverview.spec.js b/cypress/integration/facultymonitoringoverview.spec.js index 106b3a81..5e6da529 100644 --- a/cypress/integration/facultymonitoringoverview.spec.js +++ b/cypress/integration/facultymonitoringoverview.spec.js @@ -1,4 +1,4 @@ -import { testFacultyCode } from '../../config/common' +import { testFacultyCode, defaultYears } from '../../config/common' describe('Overview page tests', () => { const cypressSuperAdmin = 'cypressSuperAdminUser' @@ -7,8 +7,8 @@ describe('Overview page tests', () => { cy.login(cypressSuperAdmin) cy.visit(`/admin`) cy.contains('Deadline settings').click() - cy.createDeadline(2024, 'Toimenpiteiden toteutus ja seuranta tiedekunnissa') - cy.get('[data-cy=form-8-deadline]').contains('2024') + cy.createDeadline(defaultYears[0], 'Toimenpiteiden toteutus ja seuranta tiedekunnissa') + cy.get('[data-cy=form-8-deadline]').contains('14.') cy.visit(`/faculty-monitoring`) }) diff --git a/cypress/integration/homepage.spec.js b/cypress/integration/homepage.spec.js index 2f429465..2be47a29 100644 --- a/cypress/integration/homepage.spec.js +++ b/cypress/integration/homepage.spec.js @@ -1,3 +1,5 @@ +import { defaultYears } from '../../config/common' + describe('homepage tests', () => { beforeEach(() => { const ospaUser = 'cypressOspaUser' @@ -18,8 +20,8 @@ describe('homepage tests', () => { cy.contains('Deadline settings').click() - cy.createDeadline(2024, 'Vuosiseuranta') - cy.get('[data-cy=form-1-deadline]').contains('2024') + cy.createDeadline(defaultYears[0], 'Vuosiseuranta') + cy.get('[data-cy=form-1-deadline]').contains('14.') cy.visit('/') diff --git a/cypress/integration/metaevaluation.spec.js b/cypress/integration/metaevaluation.spec.js index 56ae444e..ea459834 100644 --- a/cypress/integration/metaevaluation.spec.js +++ b/cypress/integration/metaevaluation.spec.js @@ -5,6 +5,7 @@ import { testProgrammeName, testProgrammeCodeDoctor, testProgrammeNameDoctor, + defaultYears, } from '../../config/common' describe('Meta evaluation form & overview tests', () => { @@ -67,8 +68,8 @@ describe('Meta evaluation form & overview tests', () => { cy.get('[data-cy=nav-admin]').click() cy.contains('Deadline settings').click() - cy.createDeadline(2024, 'Katselmus - toimeenpano') - cy.get('[data-cy=form-7-deadline]').contains('2024') + cy.createDeadline(defaultYears[0], 'Katselmus - toimeenpano') + cy.get('[data-cy=form-7-deadline]').contains('14.') cy.login(cypressOspa) cy.visit('/') @@ -115,8 +116,8 @@ describe('Meta evaluation form & overview tests', () => { cy.get('[data-cy=nav-admin]').click() cy.contains('Deadline settings').click() - cy.createDeadline(2024, 'Katselmus - toimeenpano') - cy.get('[data-cy=form-7-deadline]').contains('2024') + cy.createDeadline(defaultYears[0], 'Katselmus - toimeenpano') + cy.get('[data-cy=form-7-deadline]').contains('14.') cy.visit(`/meta-evaluation/form/7/${testProgrammeCodeDoctor}`) cy.typeInEditor('T1', '2345') diff --git a/cypress/integration/trackingpage.spec.js b/cypress/integration/trackingpage.spec.js index 60f225c7..76bbe792 100644 --- a/cypress/integration/trackingpage.spec.js +++ b/cypress/integration/trackingpage.spec.js @@ -1,4 +1,4 @@ -import { testFacultyCode, testFacultyName } from '../../config/common' +import { testFacultyCode, testFacultyName, defaultYears } from '../../config/common' describe('Tracking page tests', () => { const cypressSuperAdmin = 'cypressSuperAdminUser' @@ -7,8 +7,8 @@ describe('Tracking page tests', () => { cy.login(cypressSuperAdmin) cy.visit(`/admin`) cy.contains('Deadline settings').click() - cy.createDeadline(2024, 'Toimenpiteiden toteutus ja seuranta tiedekunnissa') - cy.get('[data-cy=form-8-deadline]').contains('2024') + cy.createDeadline(defaultYears[0], 'Toimenpiteiden toteutus ja seuranta tiedekunnissa') + cy.get('[data-cy=form-8-deadline]').contains('14.') cy.visit(`/faculty-monitoring/${testFacultyCode}`) }) diff --git a/server/scripts/draftAndFinalAnswers.js b/server/scripts/draftAndFinalAnswers.js index fbd0ead3..d60d955b 100644 --- a/server/scripts/draftAndFinalAnswers.js +++ b/server/scripts/draftAndFinalAnswers.js @@ -109,7 +109,7 @@ const createDraftAnswers = async (newYear, form) => { } else { let toOpen = [] - if (form === formKeys.EVALUATION_FACULTIES || form === formKeys.FACULTY_MONITORING) { + if (form === formKeys.EVALUATION_FACULTIES) { toOpen = await db.faculty.findAll({}) } else if (form === formKeys.EVALUATION_COMMTTEES) { toOpen = committeeList @@ -153,7 +153,7 @@ const createDraftAnswers = async (newYear, form) => { const createFinalAnswers = async (newYear, form) => { logger.info(`Creating final answers for the year ${newYear} for form ${form}`) - if (form === formKeys.EVALUATION_FACULTIES || form === formKeys.FACULTY_MONITORING) { + if (form === formKeys.EVALUATION_FACULTIES) { await handleNonProgrammeFinalAnswers(form) } if (form === formKeys.EVALUATION_COMMTTEES) {