Skip to content

Commit

Permalink
fix(test): corrected CUR activity period and changed the course summa…
Browse files Browse the repository at this point in the history
…ry visit route on spec
  • Loading branch information
HRemonen committed Aug 16, 2024
1 parent daead70 commit 6023dc1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cypress/integration/courseSummary.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('Course summary', () => {
body: summaryUser,
})
cy.loginAs(summaryUser)
cy.visit(`/course-summary?startDate=2023-08-01&endDate=2024-07-31&option=year`)
cy.visit(`/course-summary`)
})

it('Should have data in My Organisations and my courses', () => {
Expand Down
8 changes: 5 additions & 3 deletions src/server/test/seedSummary.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { startOfDay } = require('date-fns')
const { startOfDay, subDays } = require('date-fns')
const {
Organisation,
CourseUnit,
Expand All @@ -15,6 +15,8 @@ const getUniversitySurvey = require('../services/surveys/universitySurvey')
const { createTestObject } = require('./utils')
const { buildSummaries } = require('../services/summary/buildSummaries')

const CURRENT_YEAR = new Date().getFullYear()

const getTestData = async () => {
const TEST_ORG_ID = 'norppa-summary-test-org-1'
const TEST_COURSE_UNIT_ID = 'norppa-test-course-unit-id-1'
Expand Down Expand Up @@ -90,8 +92,8 @@ const initTestSummary = async ({ user }) => {
en: 'Summary test course realisation',
sv: 'asdasdasd',
},
startDate: startOfDay(new Date('2023-08-01')),
endDate: startOfDay(new Date('2023-12-31')),
startDate: startOfDay(new Date(`${CURRENT_YEAR}-01-01`)),
endDate: startOfDay(startOfDay(subDays(new Date(), 1))),
})

await createTestObject(CourseRealisationsOrganisation, {
Expand Down

0 comments on commit 6023dc1

Please sign in to comment.