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

test("Vietnamese can be selected in settings and used in chat", WEB, async ({ t3, app, screen }) => {
  const project = await t3.project("Translation demo");
  const thread = await t3.thread({ project, title: "Vietnamese chat", messages: ["Start"] });
  await t3.open("/settings/general");
  await screen.getByLabel("Language", { exact: true }).tap();
  await app.screenshot("language-selector");
  const vietnamese = screen.getByText("Tiếng Việt", { exact: true });
  await expect(vietnamese).toBeVisible();
  await vietnamese.tap();
  await screen.getByLabel("Ngôn ngữ", { exact: true }).waitFor();
  await app.screenshot("vietnamese-settings");
  await t3.open(thread);
  await screen.getByRole("textbox").waitFor();
  await app.screenshot("vietnamese-chat");
});
