test(e2e): enforce parity spec typecheck
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import { expect, test, type Page, type Route } from '@playwright/test';
|
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 gamePort = process.env.FRONTEND_PARITY_GAME_PORT ?? '15102';
|
||||||
const response = (data: unknown) => ({ result: { data } });
|
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 { mkdir } from 'node:fs/promises';
|
||||||
import { resolve } from 'node:path';
|
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 artifactRoot = process.env.FRONTEND_PARITY_ARTIFACT_DIR;
|
||||||
const gamePort = process.env.FRONTEND_PARITY_GAME_PORT ?? '15102';
|
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 { dirname, extname, resolve } from 'node:path';
|
||||||
import { fileURLToPath } from 'node:url';
|
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';
|
import { gameUrl, gatewayUrl } from './testUrls.js';
|
||||||
|
|
||||||
const repositoryRoot = resolve(dirname(fileURLToPath(import.meta.url)), '../..');
|
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 { fileURLToPath } from 'node:url';
|
||||||
import { generateKeyPairSync } from 'node:crypto';
|
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';
|
import { gameOrigin, gameUrl, gatewayUrl } from './testUrls.js';
|
||||||
|
|
||||||
const repositoryRoot = resolve(dirname(fileURLToPath(import.meta.url)), '../..');
|
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> => {
|
const installAuthenticatedGameFixture = async (page: Page): Promise<void> => {
|
||||||
let surveyVoted = false;
|
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 installImages(page);
|
||||||
await page.addInitScript(
|
await page.addInitScript(
|
||||||
({ gameToken, profile }) => {
|
({ gameToken, profile }) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user