Files
Cibello-app/apps/worker/test/proactive-tip-i18n.test.ts
T
Sven (AAMOS AI) 881c5bb1e3 fix(worker): S2 proactive tips logic, i18n parity, hardened test DB reset
- processProactiveTips now iterates all expiring items sorted by urgency and
  emits the first candidate with a recipe that clears 7-day dedup.
- Add pt-PT proactive-tip templates; remove en-GB duplicate; parity test
  asserts against shared-types SUPPORTED_LANGUAGE_TAGS.
- Serialize DB test setup via turbo dependencies; seed truncates only *_test
  DBs, guarded by both --test flag and DB name suffix.
2026-08-10 04:35:22 +07:00

26 lines
824 B
TypeScript

import { describe, it, expect } from "vitest";
import { TEMPLATES } from "../src/templates/proactive-tips.js";
import { SUPPORTED_LANGUAGE_TAGS } from "@app/shared-types";
describe("proactive tip i18n parity", () => {
const canonical = new Set<string>(SUPPORTED_LANGUAGE_TAGS);
for (const [variant, locales] of Object.entries(TEMPLATES)) {
it(`${variant} täcker exakt de kanoniska språken utan dubbletter`, () => {
const keys = Object.keys(locales);
const uniqueKeys = new Set(keys);
expect(keys).toHaveLength(SUPPORTED_LANGUAGE_TAGS.length);
expect(uniqueKeys.size).toBe(keys.length);
for (const tag of SUPPORTED_LANGUAGE_TAGS) {
expect(keys).toContain(tag);
}
for (const key of keys) {
expect(canonical.has(key)).toBe(true);
}
});
}
});