Skip to content

Commit

Permalink
fix: stuff was broken
Browse files Browse the repository at this point in the history
  • Loading branch information
tfhuhtal committed Dec 2, 2024
1 parent 58ab254 commit c35c4d9
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 14 deletions.
6 changes: 3 additions & 3 deletions cypress/integration/facultymonitoringoverview.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { testFacultyCode } from '../../config/common'
import { testFacultyCode, defaultYears } from '../../config/common'

describe('Overview page tests', () => {
const cypressSuperAdmin = 'cypressSuperAdminUser'
Expand All @@ -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`)
})

Expand Down
6 changes: 4 additions & 2 deletions cypress/integration/homepage.spec.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { defaultYears } from '../../config/common'

describe('homepage tests', () => {
beforeEach(() => {
const ospaUser = 'cypressOspaUser'
Expand All @@ -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('/')

Expand Down
9 changes: 5 additions & 4 deletions cypress/integration/metaevaluation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
testProgrammeName,
testProgrammeCodeDoctor,
testProgrammeNameDoctor,
defaultYears,
} from '../../config/common'

describe('Meta evaluation form & overview tests', () => {
Expand Down Expand Up @@ -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('/')
Expand Down Expand Up @@ -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')
Expand Down
6 changes: 3 additions & 3 deletions cypress/integration/trackingpage.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { testFacultyCode, testFacultyName } from '../../config/common'
import { testFacultyCode, testFacultyName, defaultYears } from '../../config/common'

describe('Tracking page tests', () => {
const cypressSuperAdmin = 'cypressSuperAdminUser'
Expand All @@ -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}`)
})

Expand Down
4 changes: 2 additions & 2 deletions server/scripts/draftAndFinalAnswers.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit c35c4d9

Please sign in to comment.