feat(i18n): localize inventory categories UI

This commit is contained in:
2026-06-12 23:01:33 +02:00
parent 589b042e7c
commit e9a07eb28e
14 changed files with 315 additions and 17 deletions
+30
View File
@@ -68,6 +68,36 @@ test.describe("language switcher", () => {
await expectLocaleCookie(page, "es")
})
test("renders inventory categories copy in the active locale", async ({
baseURL,
page,
}) => {
await signInAsAdmin(page, baseURL)
await setLocaleCookie(page, "es", baseURL)
await page.goto("/inventory/categories")
await expect(page.locator("html")).toHaveAttribute("lang", "es")
await expect(
page.getByRole("heading", { name: "Categorías" }),
).toBeVisible()
await expect(
page.getByRole("link", { name: /Agregar categoría/ }),
).toBeVisible()
await expect(page.getByText("No se encontraron categorías.")).toBeVisible()
await page.goto("/inventory/categories/new")
await expect(
page.getByRole("heading", { name: "Nueva categoría" }),
).toBeVisible()
await expect(page.getByLabel("Nombre")).toBeVisible()
await expect(page.getByPlaceholder("Nombre de la categoría")).toBeVisible()
await expect(
page.getByRole("button", { name: "Crear categoría" }),
).toBeVisible()
})
test("switches the authenticated dashboard language from the navbar", async ({
baseURL,
page,