Files
ThothII/frontend/e2e/archive-repair.spec.ts
T
Codex 82e2c91f42
Publish documentation / publish (push) Successful in 1m27s
feat: implement memory and evidence administration with guided repairs
Add PostgreSQL-backed memory, editable evidence with source review and activation, and human-approved archive repairs across the harness, API, and UI. Include migrations, deployment support, regression coverage, and validation documentation.

Refresh permissions from validated session roles so existing administrator logins can access newly deployed archive management features.
2026-09-10 10:31:34 +02:00

30 lines
1.7 KiB
TypeScript

import { test, expect } from "@playwright/test";
import { createServer, type ViteDevServer } from "vite";
let server: ViteDevServer;
let url: string;
test.beforeAll(async () => {
server = await createServer({ server: { host: "127.0.0.1", port: 0 } });
await server.listen();
url = server.resolvedUrls!.local[0]! + "e2e/fixtures/archive-repair.html";
});
test.afterAll(async () => { await server?.close(); });
test("reviewer selects a correction, sees pending activation and retries on desktop/mobile", async ({ page }) => {
const errors: string[] = [];
page.on("pageerror", e => errors.push(e.message));
await page.setViewportSize({ width: 1280, height: 900 });
await page.goto(url);
await expect(page.getByRole("region", { name: "Archive conflict repair" })).toBeVisible();
await page.screenshot({ path: "/private/tmp/thothii-x1-repair-desktop.png", fullPage: true });
await page.setViewportSize({ width: 390, height: 844 });
expect(await page.evaluate(() => document.documentElement.scrollWidth)).toBeLessThanOrEqual(390);
await page.screenshot({ path: "/private/tmp/thothii-x1-repair-mobile.png", fullPage: true });
await page.getByRole("button", { name: "Apply this correction to Evidence" }).click();
await expect(page.getByRole("status").filter({ hasText: "Correction saved" })).toContainText("activation is incomplete");
await page.getByRole("button", { name: "Retry selected correction" }).click();
await expect(page.getByRole("status").filter({ hasText: "Correction saved" })).toContainText("active in the archive index");
const responses = JSON.parse(await page.locator("#response").textContent() || "[]");
expect(responses.map((r: { choices: string[] }) => r.choices)).toEqual([["e"], ["e"]]);
expect(errors).toEqual([]);
});