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

test("Polish can be selected and translates settings and chat", WEB, async ({t3, app, screen}) => {
  const project = await t3.project("Localization demo");
  const thread = await t3.thread({project, title: "Polish interface", messages: ["Start"]});
  await t3.open("/settings/general");
  await screen.getByLabel("Language", {exact: true}).tap();
  await app.screenshot("language-options");
  await expect(screen.getByText("Polski", {exact: true})).toBeVisible();
  await screen.getByText("Polski", {exact: true}).tap();
  await screen.getByLabel("Język", {exact: true}).waitFor();
  await app.screenshot("polish-settings");
  await expect(screen.getByLabel("Język", {exact: true})).toBeVisible();
  await t3.open(thread);
  await screen.getByText("first fixture turn complete", {exact: false}).waitFor();
  await app.screenshot("polish-chat");
});
