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

test("A published GitHub SSH host finds the repository's pull request", WEB, async ({ t3, app, screen }) => {
  await t3.project("Forge SSH remote", {
    ".git/config": '[remote "origin"]\n  url = ssh://git@ssh.github.com:443/pingdotgg/t3code.git\n  fetch = +refs/heads/*:refs/remotes/origin/*\n',
  });
  await t3.open();
  await screen.getByRole("textbox").fill("#34898");
  const result = screen.getByText("Codex goals wait for a delegated task", { exact: false });
  await result
    .or(screen.getByText("Pull requests could not be read for this project.", { exact: true }))
    .or(screen.getByText("Pull requests are not available for this project.", { exact: true }))
    .first().waitFor({ timeout: 30000 });
  await app.screenshot("ssh-host-pr-lookup");
  await expect(result).toBeVisible();
});
