Commit Graph
1 Commits
Author SHA1 Message Date
kamaskandClaude Opus 5.5 74d3c660f9 test(auth): add failing tests for auth service and pb_auth cookie
Tests first for task 2.2; the implementation comes separately.

- AuthService contract (auth/testing/auth-service.contract.ts), run on
  the in-memory fake (unit) and on PocketBaseAuthService against a test
  PocketBase (integration)
- integration: register persists the user, login maps id/email/name,
  restore with a valid, broken or missing token, signals follow the auth
  store, two users in separate injectors, NetworkError and kept session
  when PocketBase is unreachable
- unit (jsdom): pb_auth cookie is written on sign-in and removed on
  sign-out with Path=/ and SameSite=Lax, loaded into the auth store
  before restore() at startup, untouched on the server platform
- contract stubs that throw "Not implemented": User, AuthService,
  PocketBaseAuthService, provideAuth, InMemoryAuthService (signInAs,
  failNextWith)
- docs/testing.md: note on the AuthService contract

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 22:41:32 +03:00