import { expect } from "e2e";
import { test, WEB } from "./t3.ts";

test("onboarding rechecks Claude when its real install finishes with the terminal open", WEB, async ({ t3, app, screen, browser }) => {
  await t3.project("Install demo");
  await t3.open("/welcome");
  await screen.getByRole("button", "Add more agents").tap();
  await screen.getByRole("button", "Install: Claude").tap();
  await screen.getByText("Review the command, then press Enter to run it.").waitFor();
  await browser.locator("[data-thread-terminal-drawer] canvas").tap();
  await browser.keyboard.press("Enter");
  await new Promise((resolve) => setTimeout(resolve, 105_000));
  await app.screenshot("install-finished-terminal-open");
  await expect(screen.getByRole("button", "Sign in: Claude")).toBeVisible();
});
