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

test("A seeded title omits an Arabic number cluster that cannot fit", WEB, async ({ t3, app, screen }) => {
  await t3.project("demo");
  await t3.open();
  const prefix = "a".repeat(49);
  const composer = screen.getByRole("textbox");
  await composer.fill(`${prefix}\u0600\u0661 notes`);
  await composer.press("Enter");
  const title = screen.getByRole("heading", new RegExp(`^${prefix}`));
  await title.waitFor();
  await app.screenshot("arabic-number-title-cutoff");
  expect(await title.textContent()).toBe(`${prefix}...`);
});
