From 44f81eaa603b64fa294126034e5dc0307fc045c1 Mon Sep 17 00:00:00 2001 From: Diego Rodrigues de Sa e Souza <8016841+diegosouzapw@users.noreply.github.com> Date: Tue, 23 Jun 2026 07:46:31 -0300 Subject: [PATCH] fix(dashboard): add missing onboarding.tiers step title (#4698) (#4755) Co-authored-by: Diego Rodrigues de Sa e Souza --- CHANGELOG.md | 1 + src/i18n/messages/en.json | 1 + .../onboarding-step-titles-i18n-4698.test.ts | 34 +++++++++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 tests/unit/onboarding-step-titles-i18n-4698.test.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index ec49834698..29f6c75688 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ _In development — bullets added per PR; finalized at release._ ### 🔧 Bug Fixes - **db-backups**: make the database-import size cap configurable via `OMNIROUTE_DB_IMPORT_MAX_MB` (default 100 MB, 4 GB ceiling) so backups larger than 100 MB can be restored; error message now points to the env var and to VACUUM (#4719). +- **Onboarding**: add the missing `onboarding.tiers` step-title translation so the setup wizard no longer crashes with `MISSING_MESSAGE: onboarding.tiers` (#4698). --- diff --git a/src/i18n/messages/en.json b/src/i18n/messages/en.json index 6d650df399..f39e92a8ab 100644 --- a/src/i18n/messages/en.json +++ b/src/i18n/messages/en.json @@ -3816,6 +3816,7 @@ }, "onboarding": { "welcome": "Welcome", + "tiers": "Tiers", "security": "Security", "test": "Test", "ready": "Ready!", diff --git a/tests/unit/onboarding-step-titles-i18n-4698.test.ts b/tests/unit/onboarding-step-titles-i18n-4698.test.ts new file mode 100644 index 0000000000..2d81d2c89d --- /dev/null +++ b/tests/unit/onboarding-step-titles-i18n-4698.test.ts @@ -0,0 +1,34 @@ +// #4698 — the onboarding wizard rendered each step title via t(stepId), but the "tiers" +// step had no matching onboarding.tiers key, so next-intl threw +// "MISSING_MESSAGE: onboarding.tiers (en)" and the wizard crashed. Guard that every step +// id used as a title resolves to a string in the source (en) catalog. +import test from "node:test"; +import assert from "node:assert/strict"; +import { readFileSync } from "node:fs"; +import { fileURLToPath } from "node:url"; + +// Mirrors STEP_IDS in src/app/(dashboard)/dashboard/onboarding/page.tsx and the +// title lookup `t(id === "done" ? "ready" : id)`. +const STEP_IDS = ["welcome", "tiers", "security", "provider", "test", "done"]; +const titleKeyFor = (id: string) => (id === "done" ? "ready" : id); + +const enPath = fileURLToPath( + new URL("../../src/i18n/messages/en.json", import.meta.url) +); +const en = JSON.parse(readFileSync(enPath, "utf8")); + +test("every onboarding step has a string title key in en.json (#4698)", () => { + const onboarding = en.onboarding ?? {}; + for (const id of STEP_IDS) { + const key = titleKeyFor(id); + assert.equal( + typeof onboarding[key], + "string", + `onboarding.${key} (for step "${id}") must be a string title` + ); + } +}); + +test("onboarding.tiers specifically exists (regression guard #4698)", () => { + assert.equal(typeof en.onboarding?.tiers, "string"); +});