Test the authentication and protected-route flows #63

Closed
opened 2026-09-26 13:58:56 +00:00 by belvedere · 1 comment
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").
Author
Collaborator

Duplicate of #11 — created by a re-run whose pagination helper only saw the first page of issues. Closing to keep the backlog clean. Repo owner can delete this outright.

Duplicate of #11 — created by a re-run whose pagination helper only saw the first page of issues. Closing to keep the backlog clean. Repo owner can delete this outright.
Sign in to join this conversation.
No project
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#63
No description provided.