mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-14 22:41:09 +02:00
83 new tests across 5 files — pure-logic, fast, run on every push. Caught one real bug + motivated one small refactor. Coverage: - apps/mana/.../website/constants.test.ts (8): isValidSlug + RESERVED_SLUGS + isValidPath. Caught the 1-char-slug bug (regex allowed length 1; UI + plan say min 2). Fixed the regex in both the webapp and the mirrored server list. - apps/mana/.../website/publish.test.ts extended (8 total): adds self-parent cycle, 3-level nesting, all-orphans, empty-input cases on top of the original determinism + orphan-drop tests. - apps/mana/.../website/templates.test.ts (7): parameterised over each of the 4 bundled templates — clone produces fresh UUIDs, page + block counts match, navConfig populated. Plus unknown-template and duplicate-slug rejection. Container-nesting is punted to the smoke test (none of the bundled templates use columns yet). - packages/website-blocks/src/schemas.test.ts (38): every block (11) + sanity-checks (defaults satisfy own schema, enum + length bounds, required fields). Pure Zod — no Svelte runtime needed. - packages/website-blocks/src/themes/themes.test.ts (12): preset parity, resolveTheme overrides, themeCssVars output format + heading-font fallback. - apps/api/src/modules/website/reserved-slugs.test.ts (10): mirror of the client tests for the server SSOT, plus new hostname validation cases (.mana.how reservation, length, malformed edges). Refactor: - apps/api/src/modules/website/reserved-slugs.ts now owns isValidHostname + RESERVED_HOSTNAMES. domains.ts imports them. Pure functions live next to the other pure validators; easier to test + share. All 83 new tests green. Web-app svelte-check + apps/api type-check both clean. Existing publish.test.ts / website-blocks tests still pass (the monorepo-wide count is now well above 83 — these are the new ones from this commit). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| src | ||
| package.json | ||
| tsconfig.json | ||