Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

---

Expand Down
1 change: 1 addition & 0 deletions src/i18n/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -3816,6 +3816,7 @@
},
"onboarding": {
"welcome": "Welcome",
"tiers": "Tiers",
"security": "Security",
"test": "Test",
"ready": "Ready!",
Expand Down
34 changes: 34 additions & 0 deletions tests/unit/onboarding-step-titles-i18n-4698.test.ts
Original file line number Diff line number Diff line change
@@ -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");
});
Comment on lines +5 to +34

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The repository is configured to use Vitest (as indicated by vitest.config.ts in the root and the repository style guide). Using Node's native node:test and node:assert runner introduces inconsistency and may bypass Vitest's reporting, coverage, and configuration. Please rewrite the test to use Vitest's test and expect APIs.

import { test, expect } from "vitest";
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);
    expect(typeof onboarding[key]).toBe("string");
  }
});

test("onboarding.tiers specifically exists (regression guard #4698)", () => {
  expect(typeof en.onboarding?.tiers).toBe("string");
});

Loading