Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

-chatIndexTitlebar.test.ts

20 lines957 Bytes

1// @effect-diagnostics nodeBuiltinImport:off - Regression coverage compares the onboarding header with the shared titlebar contract.
2import * as NodeFS from "node:fs";
3​
4import { describe, expect, it } from "vite-plus/test";
5​
6describe("hosted static onboarding header", () => {
7 it("uses the shared workspace topbar geometry", () => {
8 const routeSource = NodeFS.readFileSync(new URL("./_chat.index.tsx", import.meta.url), "utf8");
9 const onboardingStart = routeSource.indexOf("function HostedStaticOnboardingState()");
10 const onboardingEnd = routeSource.indexOf('<Empty className="flex-1">', onboardingStart);
11​
12 expect(onboardingStart).toBeGreaterThanOrEqual(0);
13 expect(onboardingEnd).toBeGreaterThan(onboardingStart);
14​
15 const onboardingHeader = routeSource.slice(onboardingStart, onboardingEnd);
16​
17 expect(onboardingHeader).toContain("workspace-topbar");
18 expect(onboardingHeader).not.toMatch(/(?:^|\s)(?:[\w-]+:)*py-/);
19 });
20});