@devries-cameron20 / t3code Mirror · read-only
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

Mirrored from https://github.com/Camo67/t3code.git

Synced Nov 21, 03:37 UTC

main
ts 42 lines 1.89 KB
Raw
1 import { expect } from "e2e";
2
3 import { test, WEB } from "./t3.ts";
4
5 test(
6 "An idle numbered terminal shows its name in the app's language after switching threads",
7 WEB,
8 async ({ t3, app, browser, screen }) => {
9 const project = await t3.project("demo");
10 const thread = await t3.thread({ project, title: "Terminal work", messages: ["Start"] });
11 await t3.thread({ project, title: "Other work", messages: ["Start"] });
12
13 await t3.open("/settings/general");
14 await screen.getByLabel("Language", { exact: true }).tap();
15 await screen.getByText("日本語", { exact: true }).tap();
16 await screen.getByLabel("言語", { exact: true }).waitFor();
17
18 await t3.open(thread);
19 const drawerToggle = screen.getByRole("button", "ターミナルドロワーの切り替え");
20 await drawerToggle.tap();
21 const input = browser.locator('[aria-label="ターミナルの入力"][data-workspace-focus-default]');
22 await input.waitFor();
23 await screen.getByRole("button", /^新しいターミナル(?: \(|$)/).tap();
24 const secondTerminal = screen.getByRole("button", /^(?:Terminal 2|ターミナル 2)$/);
25 await secondTerminal.waitFor();
26 await screen.getByRole("button", "Other work", { exact: false }).tap();
27 await screen.getByRole("button", "Terminal work", { exact: false }).tap();
28
29 // Wait for a real process label so the idle assertion reads server metadata, not the fallback
30 // shown while the second terminal is opening.
31 await secondTerminal.tap();
32 await input.focus();
33 await browser.keyboard.type("sleep 60\n");
34 await screen.getByRole("button", "sleep", { exact: true }).waitFor({ timeout: 40_000 });
35 await input.focus();
36 await browser.keyboard.press("Control+C");
37 await secondTerminal.waitFor({ timeout: 40_000 });
38
39 await app.screenshot("idle-terminal-after-switch");
40 await expect(secondTerminal).toHaveText("ターミナル 2");
41 },
42 );