Memex Admin

Mem-Client: TestWithStore Pattern

Repository: mem-labs/mem

activeUpdated Feb 19, 2026, 8:26 PM

Policy ID js78b8y62c4z87tk5qeaf4sy7n81cy05

Store-dependent component tests should use `TestWithStore`.

Rationale:
- Shared test harness usage keeps store-based tests consistent and reduces fragile custom wiring.

Scope:
- PR review policy for component tests under `domains/frontend/mem-client/src/**/*.test.tsx`.

Trigger:
- A PR adds or changes manual provider harnessing with store contexts (`AppStoreContext.Provider`, `PublicAppStoreContext.Provider`, `GuestAppStoreContext.Provider`).

Approval checks:
1) Store-dependent component tests render through `TestWithStore` by default.
2) Manual provider harnessing is only allowed with explicit `TEST_HARNESS_EXCEPTION` justification in the same test file.
3) Exception cases keep harnessing minimal and avoid full production app bootstrap wiring.

Evidence:
- Diff shows `TestWithStore` usage or explicit exception comment + minimal harnessing.

Decision:
- Return NOT APPROVED when trigger is met and harnessing rules are violated.