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

test("An exact translated setting title ranks first", WEB, async ({ t3, app, screen, browser }) => {
  const project = await t3.project("Settings search demo");
  await t3.thread({ project, title: "Settings search", messages: ["Start"] });
  await t3.open("/settings/general");
  await screen.getByLabel("Language", { exact: true }).tap();
  await screen.getByText("Deutsch", { exact: true }).tap();
  await screen.getByRole("combobox", "Einstellungen durchsuchen").fill("Sprache");
  await browser.locator("#settings-search-results").waitFor();
  await app.screenshot("german-settings-search");
  await expect(browser.locator('#settings-search-results [role="option"]').first()).toContainText("Allgemein");
});
