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

test("Diagnostics process badges use German singular and plural", WEB, async ({ t3, app, screen }) => {
  await t3.project("diagnostics-demo");
  await t3.open("/settings/general");
  await screen.getByRole("combobox", "Language").tap();
  await screen.getByRole("option", "Deutsch").tap();
  await t3.open("/settings/diagnostics");
  await screen.getByText("Backend + Agenten", { exact: true }).waitFor();
  await screen.getByText(/^[1-9]\d* (process|processes|Prozess|Prozesse)$/).first().waitFor({ timeout: 60_000 });
  await app.screenshot("german-diagnostics-process-badges");
  await expect(screen.getByText(/^0 Prozesse$/)).toBeVisible();
  await expect(screen.getByText(/^1 Prozess$/)).toBeVisible();
  await expect(screen.getByText(/^[2-9]\d* Prozesse$/)).toBeVisible();
});
