|
1 | 1 | import { createRequire } from "node:module" |
| 2 | +import { execFileSync } from "node:child_process" |
| 3 | +import { fileURLToPath } from "node:url" |
2 | 4 | import { mkdtemp, rm } from "node:fs/promises" |
3 | 5 | import { tmpdir } from "node:os" |
4 | 6 | import path from "node:path" |
5 | 7 | import { startPanelPreview } from "./composer-panel-preview.mjs" |
6 | 8 | import { session } from "./composer-fixture.mjs" |
7 | 9 |
|
8 | 10 | const { chromium, _electron, expect } = createRequire(new URL("../../app/package.json", import.meta.url))("@playwright/test") |
9 | | -const preview = await startPanelPreview() |
| 11 | +const prior = process.argv.includes("--pre147") && execFileSync("jj", ["file", "show", "-r", "849a6b4238ff", "packages/es-app/src/live-session.ts"], |
| 12 | + { cwd: fileURLToPath(new URL("../../..", import.meta.url)), encoding: "utf8" }) |
| 13 | +const preview = await startPanelPreview(prior ? [{ name: "pre147-session-switch", enforce: "pre", |
| 14 | + transform(_code, id) { return id.endsWith("/src/live-session.ts") ? prior : undefined } }] : []) |
10 | 15 | const fixture = preview.fixture |
11 | 16 | fixture.sessionIDs.push("ses_c") |
12 | 17 | fixture.children.set("ses_child", { session: { ...session("ses_child"), parentID: "ses_a", title: "Child inspection" }, messages: [] }) |
|
95 | 100 | await tab() |
96 | 101 | expect(new URL(page.url()).pathname).toBe("/session/ses_a") |
97 | 102 | await expect(page.getByLabel("Model override", { exact: true })).not.toBeFocused() |
98 | | - await page.getByRole("button", { name: "Explore Inspect child" }).click() |
| 103 | + await expect(page.locator(".topbar")).toContainText("Composer fixture") |
| 104 | + await page.locator('[data-tool="task"]').getByRole("button", { name: /Inspect child/ }).click() |
99 | 105 | const dialog = page.getByRole("dialog") |
100 | 106 | await expect(dialog).toContainText("No messages yet.") |
101 | 107 | await dialog.locator(".subagent-transcript").focus() |
|
0 commit comments