docs: convention for Svelte 5 test fixtures (reactive prop drivers) #637

Open
opened 2026-05-19 23:32:43 +02:00 by marcel · 0 comments
Owner

Context

PR #629 introduced MentionDropdown.test-fixture.svelte — a tiny host component that exposes setters for reactive props so tests can drive prop changes that Svelte 5's mount() API can't natively support (since mount returns no settable prop accessors).

Markus (#10959) and Felix (#10968) raised this as an undocumented pattern that should be written down before a second instance appears outside frontend/src/lib/shared/discussion/.

Required

  • Document the pattern: where to colocate the fixture (X.test-fixture.svelte next to X.svelte), how to expose a setter via onReady, when to prefer fixture over rerender().
  • Reference from frontend/CLAUDE.md testing section, or add a short README under frontend/src/lib/__test-fixtures__/ if a shared folder makes sense.
  • Optional: ESLint rule that flags imports of .test-fixture.svelte from non-test code.

Acceptance

  • Convention documented.
  • Linked from frontend testing docs.
## Context PR #629 introduced `MentionDropdown.test-fixture.svelte` — a tiny host component that exposes setters for reactive props so tests can drive prop changes that Svelte 5's `mount()` API can't natively support (since `mount` returns no settable prop accessors). Markus (#10959) and Felix (#10968) raised this as an undocumented pattern that should be written down before a second instance appears outside `frontend/src/lib/shared/discussion/`. ## Required - [ ] Document the pattern: where to colocate the fixture (`X.test-fixture.svelte` next to `X.svelte`), how to expose a setter via `onReady`, when to prefer fixture over `rerender()`. - [ ] Reference from `frontend/CLAUDE.md` testing section, or add a short README under `frontend/src/lib/__test-fixtures__/` if a shared folder makes sense. - [ ] Optional: ESLint rule that flags imports of `.test-fixture.svelte` from non-test code. ## Acceptance - [ ] Convention documented. - [ ] Linked from frontend testing docs.
marcel added the P3-laterdocumentationtest labels 2026-05-19 23:32:47 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: marcel/familienarchiv#637