test(e2e): enforce parity spec typecheck

This commit is contained in:
2026-07-31 18:21:27 +00:00
parent 3eecccee4c
commit eb47472691
4 changed files with 14 additions and 5 deletions
@@ -1,6 +1,6 @@
import { expect, test, type Page, type Route } from '@playwright/test';
import { canonicalFrontendFixture as fixture } from './fixtures/canonical';
import { canonicalFrontendFixture as fixture } from './fixtures/canonical.js';
const gamePort = process.env.FRONTEND_PARITY_GAME_PORT ?? '15102';
const response = (data: unknown) => ({ result: { data } });
@@ -2,7 +2,7 @@ import { expect, test, type Page, type Route } from '@playwright/test';
import { mkdir } from 'node:fs/promises';
import { resolve } from 'node:path';
import { canonicalFrontendFixture as fixture } from './fixtures/canonical';
import { canonicalFrontendFixture as fixture } from './fixtures/canonical.js';
const artifactRoot = process.env.FRONTEND_PARITY_ARTIFACT_DIR;
const gamePort = process.env.FRONTEND_PARITY_GAME_PORT ?? '15102';
@@ -3,7 +3,7 @@ import { readFile } from 'node:fs/promises';
import { dirname, extname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { canonicalFrontendFixture as fixture } from './fixtures/canonical';
import { canonicalFrontendFixture as fixture } from './fixtures/canonical.js';
import { gameUrl, gatewayUrl } from './testUrls.js';
const repositoryRoot = resolve(dirname(fileURLToPath(import.meta.url)), '../..');
@@ -4,7 +4,7 @@ import { dirname, extname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import { generateKeyPairSync } from 'node:crypto';
import { canonicalFrontendFixture as fixture } from './fixtures/canonical';
import { canonicalFrontendFixture as fixture } from './fixtures/canonical.js';
import { gameOrigin, gameUrl, gatewayUrl } from './testUrls.js';
const repositoryRoot = resolve(dirname(fileURLToPath(import.meta.url)), '../..');
@@ -246,7 +246,16 @@ const installHallFixture = async (page: Page): Promise<HallFixtureCalls> => {
const installAuthenticatedGameFixture = async (page: Page): Promise<void> => {
let surveyVoted = false;
const surveyComments = fixture.game.surveyDetail.comments.map((comment) => ({ ...comment }));
const surveyComments: Array<{
id: number;
voteId: number;
generalId: number;
nationId: number;
generalName: string;
nationName: string;
text: string;
createdAt: string;
}> = fixture.game.surveyDetail.comments.map((comment) => ({ ...comment }));
await installImages(page);
await page.addInitScript(
({ gameToken, profile }) => {