Files
OmniRoute/tests/e2e/visual-resilience-smoke.spec.ts
diegosouzapw 052eb8d330 refactor: replace any types with generics and add Zod validation schemas
Eliminate `any` usage across the codebase by introducing proper generics,
typed interfaces (StatementLike, DbLike, PromptRow, etc.), and helper
conversion functions (toNumber, toString, parseVariables). Add
comprehensive Zod validation schemas for API endpoint inputs to enforce
runtime type safety alongside compile-time checks.
2026-03-04 18:59:27 -03:00

21 lines
746 B
TypeScript

import { expect, test } from "@playwright/test";
const visualRoutes = ["/400", "/500", "/status", "/offline", "/maintenance"];
test.describe("Visual Smoke — Resilience Routes", () => {
for (const route of visualRoutes) {
test(`${route} renders stable viewport without horizontal overflow`, async ({ page }) => {
await page.setViewportSize({ width: 1280, height: 800 });
await page.goto(route);
const screenshotBuffer = await page.screenshot({ fullPage: false });
expect(screenshotBuffer.byteLength).toBeGreaterThan(10_000);
const hasOverflow = await page.evaluate(
() => document.documentElement.scrollWidth > window.innerWidth + 1
);
expect(hasOverflow).toBeFalsy();
});
}
});