From 428c8288d565df8dbf7657634be21d66ce4020b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Salavisa?= Date: Fri, 7 Aug 2026 18:18:40 +0200 Subject: [PATCH] test(i18n): scope the office cron guard to the namespace, not one dialog (#2376) Co-authored-by: Kandev Agent Co-authored-by: Claude Opus 5 (1M context) --- ...utine-dialog.i18n.test.ts => office-cron-i18n.test.ts} | 6 ++++-- apps/web/app/office/routines/create-routine-dialog.tsx | 8 +++----- 2 files changed, 7 insertions(+), 7 deletions(-) rename apps/web/app/office/{routines/create-routine-dialog.i18n.test.ts => office-cron-i18n.test.ts} (86%) diff --git a/apps/web/app/office/routines/create-routine-dialog.i18n.test.ts b/apps/web/app/office/office-cron-i18n.test.ts similarity index 86% rename from apps/web/app/office/routines/create-routine-dialog.i18n.test.ts rename to apps/web/app/office/office-cron-i18n.test.ts index ed2c2d6d81..cb98107b2f 100644 --- a/apps/web/app/office/routines/create-routine-dialog.i18n.test.ts +++ b/apps/web/app/office/office-cron-i18n.test.ts @@ -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; diff --git a/apps/web/app/office/routines/create-routine-dialog.tsx b/apps/web/app/office/routines/create-routine-dialog.tsx index 3adc178671..2bca459a78 100644 --- a/apps/web/app/office/routines/create-routine-dialog.tsx +++ b/apps/web/app/office/routines/create-routine-dialog.tsx @@ -225,11 +225,9 @@ function TriggerFields({ <>

{/* - 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" })}