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

const QUERY = "Find the pull request that fixes the side panel width on small screens qzxvwk";

test("A long pull request search has no space before its ellipsis", WEB, async ({ t3, app, screen }) => {
  await t3.project("demo");
  await t3.open(`/pull-requests?${new URLSearchParams({ q: QUERY })}`);
  const title = screen.getByText(/^Nothing matches/);
  await title.waitFor({ timeout: 60_000 });
  await app.screenshot("long-search-no-results");
  await expect(title).toHaveText("Nothing matches “Find the pull request that fixes the side panel…”");
});
