Add component tests for the sign-up and log-in form

Aperta
#139 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
52/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
react, typescript
Ambito
frontend, testing

Direzione di ricerca

Start with apps/web/src/components/AuthForm.tsx for the login/register behaviour and apps/web/src/lib/api.ts for the client to mock. Check whether the test setup from #108 is merged before writing anything, since the issue says to ask there if it is not. Done means at least 8 meaningful Vitest and Testing Library tests that pass under npm test and in CI, with no fixed waits.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

help wanted tests web

Difficulty: Intermediate · Estimated size: 1 day

Context

apps/web/src/components/AuthForm.tsx handles both log in and register, validation messages and the consent line. It has no unit tests. This depends on the web test setup in #108.

Problem or goal

Cover the form's behaviour with component tests so future changes do not break sign-up.

Suggested approach

  • Use Vitest and Testing Library (set up in #108).
  • Test: required fields, invalid email, short password, the register-only username field, the consent line with working links, the busy state, and that the error from a failed request is shown and announced.
  • Mock the API client, not fetch.

Where to look

  • apps/web/src/components/AuthForm.tsx
  • apps/web/src/lib/api.ts

Acceptance criteria

  • At least 8 meaningful tests, none relying on fixed waits.
  • They run in npm test and in CI.

Hints

If #108 is not merged yet, ask in that issue before starting.

How to work on it

  1. Comment here to claim it, so two people do not do the same work.
  2. Fork the repo and branch from main (feat/short-name or fix/short-name). Setup steps are in docs/DEVELOPMENT.md.
  3. Keep the change focused and add tests for backend logic.
  4. Run npm run typecheck, npm test and npm run lint and npm run format before opening the pull request.
  5. Use a Conventional Commits title (for example feat(web): add bookmarks). More in CONTRIBUTING.md.

Stuck? Ask in this issue. Questions are welcome.


Generated by Claude Code

Lingua principale
TypeScript
Stelle
6
Fork
6
Merge medio
1h 59m
PR unite (30g)
59

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Haseeb-MernStack/commune

Tutte le issue di Haseeb-MernStack/commune

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.