import { Page } from '@playwright/test'

/**
 * Override the Date/Time in a browser environment for Playwright tests.
 */
export async function setFixedDate(page: Page): Promise<void> {
  // See https://playwright.dev/docs/api/class-page#pageadinitscriptscript-arg
  await page.addInitScript({
    // Update the Date/Time in test pages.
    path: './fixtures/set-date-script.js',
  })
}
