Test the authentication and protected-route flows #11

Open
opened 2026-09-26 13:58:31 +00:00 by belvedere · 0 comments
Collaborator

Objective: Regression cover for sign-up, sign-in, sign-out and route protection.

Files:

  • Create: test/first_thousand_words_web/live/auth_flow_test.exs
  • Create: test/support/auth_case.ex or extend conn_case.ex

Steps:

  1. Test: unauthenticated GET /app is redirected to sign-in.
  2. Test: registration creates a user and lands authenticated.
  3. Test: wrong password shows an error and does not authenticate.
  4. Assert on element IDs, never raw HTML.

Verify: mix test test/first_thousand_words_web/live/auth_flow_test.exs — all pass.

Refs: AGENTS.md — LiveView tests ("Never test against raw HTML").

**Objective:** Regression cover for sign-up, sign-in, sign-out and route protection. **Files:** - Create: `test/first_thousand_words_web/live/auth_flow_test.exs` - Create: `test/support/auth_case.ex` or extend `conn_case.ex` **Steps:** 1. Test: unauthenticated GET `/app` is redirected to sign-in. 2. Test: registration creates a user and lands authenticated. 3. Test: wrong password shows an error and does not authenticate. 4. Assert on element IDs, never raw HTML. **Verify:** `mix test test/first_thousand_words_web/live/auth_flow_test.exs` — all pass. **Refs:** AGENTS.md — LiveView tests ("**Never** test against raw HTML").
Sign in to join this conversation.
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
nickkeers/first-thousand-words#11
No description provided.