managarten/packages/website-blocks/src
Till JS f20ace0358 test(website): broad automated coverage across the builder surface
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>
2026-04-23 21:07:40 +02:00
..
analytics feat(wardrobe): module foundation — garments + outfits space-scoped data layer (M1) 2026-04-23 18:27:37 +02:00
columns feat(website): M3 — 5 more blocks, containers, upload, themes 2026-04-23 14:27:49 +02:00
cta feat(website): M3 — 5 more blocks, containers, upload, themes 2026-04-23 14:27:49 +02:00
faq feat(website): M3 — 5 more blocks, containers, upload, themes 2026-04-23 14:27:49 +02:00
form feat(website): M4 — forms + moduleEmbed 2026-04-23 14:36:52 +02:00
gallery feat(website): M3 — 5 more blocks, containers, upload, themes 2026-04-23 14:27:49 +02:00
hero feat(webapp): wire isParallelSafe in Companion chat + Mission runner 2026-04-23 14:11:24 +02:00
image feat(website): M3 — 5 more blocks, containers, upload, themes 2026-04-23 14:27:49 +02:00
moduleEmbed feat(website): M4 — forms + moduleEmbed 2026-04-23 14:36:52 +02:00
richText feat(webapp): wire isParallelSafe in Companion chat + Mission runner 2026-04-23 14:11:24 +02:00
spacer feat(webapp): wire isParallelSafe in Companion chat + Mission runner 2026-04-23 14:11:24 +02:00
themes test(website): broad automated coverage across the builder surface 2026-04-23 21:07:40 +02:00
index.ts feat(wardrobe): module foundation — garments + outfits space-scoped data layer (M1) 2026-04-23 18:27:37 +02:00
registry.ts feat(wardrobe): module foundation — garments + outfits space-scoped data layer (M1) 2026-04-23 18:27:37 +02:00
schemas.test.ts test(website): broad automated coverage across the builder surface 2026-04-23 21:07:40 +02:00
schemas.ts test(website): broad automated coverage across the builder surface 2026-04-23 21:07:40 +02:00
types.ts feat(website): M3 — 5 more blocks, containers, upload, themes 2026-04-23 14:27:49 +02:00