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

test("Author fallback avatar keeps the emoji intact", WEB, async ({ t3, app, screen, browser }) => {
  await t3.project("demo");
  await t3.open("/pull-requests?author=%F0%9F%98%80dev");
  await screen.getByRole("button", /^Filters/).tap();
  await screen.getByRole("menuitem", /^Author/).tap();
  await screen.getByRole("menuitemradio", "😀dev", { exact: true }).waitFor();
  await app.screenshot("author-emoji-fallback");
  const initial = await browser.evaluate(() => document.querySelector('[role="menuitemradio"][aria-checked="true"] span[aria-hidden="true"]')?.textContent);
  expect(initial).toBe("😀");
});
