managarten/apps/mana/apps
Till JS 120a191bb0 test(workbench): pure-helper coverage for toScene + pickActiveId
Adds 10 unit tests for the two helpers we hardened this session:

- toScene round-trips the core presentation fields and the two
  previously-dropped extras (viewingAsAgentId, scopeTagIds). Guards
  against the silent field-loss regression fixed in a1baf1053.
- pickActiveId covers empty lists, surviving current, MRU fallback,
  skipping deleted MRU entries, corrupted-JSON MRU payload, and
  non-string entries. Locks down the fallback ladder introduced in
  4e5c3179f so scenes[0] stays a last resort.

Both helpers are now exported from the .svelte.ts store. The test
file mocks `$app/environment.browser=true` and polyfills localStorage
so it runs without jsdom (the web app doesn't bundle jsdom as a test
dep).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 16:19:14 +02:00
..
landing docs: add Apr 16 devlog, remove duplicate devlogs, update MODULE_REGISTRY 2026-04-17 15:27:00 +02:00
mobile refactor: rename zitare -> quotes (Zitate) 2026-04-14 20:59:16 +02:00
web test(workbench): pure-helper coverage for toScene + pickActiveId 2026-04-18 16:19:14 +02:00