Files
DeepTutor/web/tests/integration/chat-workspace.spec.tsx
Bingxi Zhao (Frank) 6e6e56aedb release: v1.6.3
Ship the breaking front- and back-end runtime and route refactor,
learner and guardian flows, grounded reading, knowledge and parser
updates, and recoverable long-running streams.

Release notes: assets/releases/ver1-6-3.md
2026-09-02 04:09:11 +08:00

27 lines
932 B
TypeScript

import fs from "node:fs";
import path from "node:path";
import { describe, expect, it } from "vitest";
const source = (relative: string) =>
fs.readFileSync(path.resolve(process.cwd(), relative), "utf8");
describe("chat workspace composition", () => {
it("keeps the route as a small composition boundary", () => {
const route = [
source("app/(workspace)/chat/page.tsx"),
source("app/(workspace)/chat/[sessionId]/page.tsx"),
].join("\n");
expect(route).toMatch(/<ChatWorkspace/);
expect(route).not.toMatch(
/apiFetch|localStorage|useState|useEffect|modal/i,
);
expect(route.split("\n").length).toBeLessThan(20);
});
it("moves session resolution behind its route controller", () => {
const workspace = source("features/chat/components/ChatWorkspace.tsx");
expect(workspace).toMatch(/useChatRouteSession/);
expect(workspace).not.toMatch(/useParams|useRouter/);
});
});