diff --git a/e2e/Degree_programme_overview.spec.ts b/e2e/Degree_programme_overview.spec.ts index aedc2bdd0..9943c9a51 100644 --- a/e2e/Degree_programme_overview.spec.ts +++ b/e2e/Degree_programme_overview.spec.ts @@ -1,8 +1,8 @@ import { test, expect, Page } from '@playwright/test' -import { checkTableStats, init } from './support/commands' +import { checkTableStats, init, testMockTime } from './support/commands' const getEmptyYears = (isAcademicYear = false) => { - const today = new Date() + const today = new Date(testMockTime) const latestYear = isAcademicYear && today.getMonth() < 7 ? today.getFullYear() - 1 : today.getFullYear() const years = [] for (let year = latestYear; year >= 2024; year--) { diff --git a/e2e/support/commands.ts b/e2e/support/commands.ts index de8481758..568e29297 100644 --- a/e2e/support/commands.ts +++ b/e2e/support/commands.ts @@ -89,6 +89,7 @@ export const init = async (page: Page, path: string, userId: UserId = 'basic', c }) }) + await page.clock.install({ time: testMockTime }) await page.goto(path || '/') }