test(i18n): scope the office cron guard to the namespace, not one dialog (#2376)

Co-authored-by: Kandev Agent <agent@kandev.dev>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
João Salavisa
2026-08-07 18:18:40 +02:00
committed by GitHub
parent cd5199cd14
commit 428c8288d5
2 changed files with 7 additions and 7 deletions
@@ -10,8 +10,10 @@ import pseudoOffice from "@/src/locales/pseudo/office.json";
* an example no cron parser accepts — and the pseudo-locale mangles it outright.
* Both office cron examples therefore carry the expression as a `values` entry.
*
* `standardCronExpressionExample` is rendered by the routine trigger fields in
* `create-routine-dialog.tsx`; `aCronScheduleExample` by the routine editor.
* The two live in different files — `standardCronExpressionExample` in
* `routines/create-routine-dialog.tsx`, `aCronScheduleExample` in
* `agents/[id]/layout.tsx` — so the guard sits at the `office` namespace root
* rather than beside either call site.
*/
describe("office cron example messages", () => {
const CRON_KEYS = ["standardCronExpressionExample", "aCronScheduleExample"] as const;
@@ -225,11 +225,9 @@ function TriggerFields({
<>
<p className="text-xs text-muted-foreground -mt-2">
{/*
The cron expression is SYNTAX, not copy: it travels as a value so
a translator (and the pseudo-locale) leaves it verbatim. Baked into
the message, reordering a field or localising `MON` yields an
example no cron parser accepts. Same reasoning as
`office:aCronScheduleExample` and `settings:externalMcpEndpointsDescription`.
The cron expression is SYNTAX, not copy: it travels as a value so a
translator cannot reword it into something no parser accepts.
Guarded by app/office/office-cron-i18n.test.ts.
*/}
{t("office:standardCronExpressionExample", { cron: "0 9 * * MON" })}
</p>