Files
siftlode/frontend/e2e/player.spec.ts
T
peter e7091158fd test(e2e): golden-master Playwright net for the Platform refactor
Locks the five flows the refactor must not break (feed, channel, player,
settings, nav) so later sprints can prove they changed nothing. Adds a thin
data-testid layer and a dedicated seeded non-demo account; the suite runs on
the baked :8080 stack (authoritative) or :5173. No product-behaviour change.
2026-07-18 00:35:57 +02:00

29 lines
1.1 KiB
TypeScript

import { test, expect } from "@playwright/test";
import { openApp, openFirstVideo } from "./helpers";
// Locks the in-app player's open/close contract. The player is a portaled overlay whose
// inconsistent mounting caused an E3 regression — exactly the kind of thing the refactor's
// overlay-root convention must not break. We assert the modal shell, not YouTube playback.
test.describe("player modal", () => {
test.beforeEach(async ({ page }) => {
// Hermetic: don't actually load the YouTube iframe/player.
await page.route(/youtube\.com/, (route) => route.abort());
});
test("opens from a card and closes via the close button", async ({ page }) => {
await openApp(page);
await openFirstVideo(page);
await page.getByTestId("player-close").click();
await expect(page.getByTestId("player-modal")).toHaveCount(0);
});
test("closes on Escape", async ({ page }) => {
await openApp(page);
await openFirstVideo(page);
await page.keyboard.press("Escape");
await expect(page.getByTestId("player-modal")).toHaveCount(0);
});
});