import { readFileSync } from "node:fs"; import { fileURLToPath } from "node:url"; import { expect } from "vitest"; import { test } from "@openwork/testkit"; const sessionPageSource = readFileSync( fileURLToPath(new URL("../../apps/app/src/react-app/domains/session/chat/session-page.tsx", import.meta.url)), "utf8", ); const buttonSource = readFileSync( fileURLToPath(new URL("../../apps/app/src/components/ui/button.tsx", import.meta.url)), "utf8", ); function spacingValue(source: string, pattern: RegExp) { const value = source.match(pattern)?.[1]; if (value === undefined) { throw new Error(`Missing geometry class matching ${pattern}`); } return Number(value) * 4; } test("the artifact count badge stays inside the desktop rail", async ({ evidence }) => { const rail = sessionPageSource.match(/