test(i18n): give the per-locale copy guards their pt-BR vocabulary

The delete-confirmation, sleep-debt, mood-prognosis, MCP-token and
AI-consent guards match each locale against its own phrases, and the
sharing-boundary guard against the word for account; pt-BR now has
them. The locale-count floors read nine, and the managed-profile picker
test counts the locale list instead of a literal.
This commit is contained in:
Marc-André Bombeck committed 2026-10-22 14:57:32 +02:00
1 parent 71123e5fae
commit 51f7d38b3c
6 files changed
+38 -10

No files matched your search

@@ -223,9 +223,9 @@ const FULL_RECORD = {
const DOTTED_KEY = /\b[a-z][A-Za-z0-9]*(\.[A-Za-z0-9_]+){2,}\b/g;
describe("<ClinicianView> resolves every label in every locale", () => {
it("covers all eight shipped locales", () => {
it("covers all nine shipped locales", () => {
// A floor: an empty locale list would make the loop below assert nothing.
expect(locales.length).toBe(8);
expect(locales.length).toBe(9);
});
for (const locale of locales) {
@@ -34,6 +34,7 @@ import { join } from "node:path";
import { renderToStaticMarkup } from "react-dom/server";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { locales } from "@/lib/i18n/config";
import { I18nProvider } from "@/lib/i18n/context";
import { ApiError } from "@/lib/api/api-fetch";
import type { AccountAccessEntry } from "@/lib/sharing/account-access-view";
@@ -285,12 +286,12 @@ describe("the managed-profile card, in the shared-access section", () => {
}
// The timezone control is the shared picker, which labels itself.
expect(html).toContain('id="managed-profile-timezone"');
// Eight languages offered, which is the route's enum exactly.
// Every shipped language offered, which is the route's enum exactly.
const options =
/<select[^>]*data-slot="managed-profile-locale"[\s\S]*?<\/select>/
.exec(html)?.[0]
.match(/<option/g) ?? [];
expect(options).toHaveLength(8);
expect(options).toHaveLength(locales.length);
// Four sex options, and the first is the empty one: null is a real answer
// ("not recorded") rather than an absent field, and a form offering only
// the three enum members would make it unsayable.