From b0f2c4df6c54e1e7d38d7ee6ab2a83c167d0f586 Mon Sep 17 00:00:00 2001 From: John Smith Date: Fri, 6 Nov 2026 13:19:11 -0500 Subject: [PATCH] test(ui): stabilize host selection mock and cross-platform test runners --- packages/ui/test/markdown-viewer.test.tsx | 4 ++-- packages/ui/test/mh2-host-level.test.tsx | 2 +- packages/ui/test/slice-20-mobile-density.test.tsx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/ui/test/markdown-viewer.test.tsx b/packages/ui/test/markdown-viewer.test.tsx index 9e2571c00..89c9e81be 100644 --- a/packages/ui/test/markdown-viewer.test.tsx +++ b/packages/ui/test/markdown-viewer.test.tsx @@ -205,10 +205,10 @@ describe("qitem-markdown-bare-marker-loop — parser terminates on a bare list m const { spawn } = await import("node:child_process"); const path = await import("node:path"); const childScript = path.resolve(import.meta.dirname, "fixtures/markdown-bare-marker-child.tsx"); - const runner = path.resolve(import.meta.dirname, "../../../node_modules/.bin/tsx"); + const tsxCli = path.resolve(import.meta.dirname, "../../../node_modules/tsx/dist/cli.mjs"); const outcome = await new Promise<{ code: number | null; signal: string | null; killed: boolean; out: string; err: string }>((resolve) => { - const child = spawn(runner, [childScript], { + const child = spawn(process.execPath, [tsxCli, childScript], { cwd: path.resolve(import.meta.dirname, ".."), // Low heap so a runaway parser dies fast instead of eating the box. env: { ...process.env, NODE_OPTIONS: "--max-old-space-size=256" }, diff --git a/packages/ui/test/mh2-host-level.test.tsx b/packages/ui/test/mh2-host-level.test.tsx index c70c728bd..c4a395c36 100644 --- a/packages/ui/test/mh2-host-level.test.tsx +++ b/packages/ui/test/mh2-host-level.test.tsx @@ -689,7 +689,7 @@ describe("rev1-r2 B1/B2 — remote action gates (topology table / terminal grid }); it("seat page remote (B1+B2): host-keyed detail fetch, NO bare local URL, actions row read-only, inline terminal gated, ZERO POSTs", async () => { - wireB1Fetch(); + wireB1Fetch("vps-a"); renderPrimed(() => , "vps-a"); await waitFor(() => expect(screen.getByTestId("live-node-actions-remote-readonly")).toBeTruthy()); // B1: no local action affordances, terminal honestly gated diff --git a/packages/ui/test/slice-20-mobile-density.test.tsx b/packages/ui/test/slice-20-mobile-density.test.tsx index b13404089..d5f03ee0c 100644 --- a/packages/ui/test/slice-20-mobile-density.test.tsx +++ b/packages/ui/test/slice-20-mobile-density.test.tsx @@ -31,7 +31,7 @@ describe("slice 20: FilesWorkspace responsive two-pane shape", () => { it("/files route mounts FilesWorkspace instead of falling through to Not Found", async () => { const source = await readSource("src/routes.tsx"); expect(source).toMatch(/import \{ FilesWorkspace \} from "\.\/components\/files\/FilesWorkspace\.js";/); - expect(source).toMatch(/path: "\/files",\n\s+component: FilesWorkspace/); + expect(source).toMatch(/path: "\/files",\r?\n\s+component: FilesWorkspace/); }); it("outer container uses flex-col on mobile + sm:flex-row on desktop", async () => {