Add unit-test coverage for app/sagas/

Aperta
#7,341 2 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
70/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
javascript, react-native, typescript

Direzione di ricerca

Inizia dai test esistenti in app/sagas/tests/videoConf.voipBlock.test.ts e deepLinking.test.ts, quindi esamina app/sagas/login.js e il relativo watcher root(). Configura l'harness suggerito di runSaga o expectSaga e copri i casi SERVER.SELECT_REQUEST e di timeout. Il lavoro è completato quando il comportamento del watcher root() è verificato e i nuovi test passano.

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

Descrizione

✅ needs tests type: feature

Background

app/sagas/ has just two existing tests (videoConf.voipBlock.test.ts, deepLinking.test.ts). Core sagas — login.js, init.js, rooms.js, messages.js, encryption.js, state.js, selectServer.ts, room.js — have no direct unit-test coverage.

Motivating example

NATIVE-1180 / #7333 / #7340: an unconditional cancel(loginSuccessTask) in login.js's root() watcher imposed a hard 2-second deadline on handleLoginSuccess and stranded users on the login screen when permission/enterprise fetches ran long. The bug lived in root()'s cancel logic for ~3 weeks before a user reported it.

A small saga harness asserting that cancel(loginSuccessTask) only fires when SERVER.SELECT_REQUEST wins the race would have failed loudly the moment the regression landed.

Suggested scope

  • Set up a saga test harness under app/sagas/__tests__/ using runSaga or expectSaga from @redux-saga/testing-utils.
  • First pass: cover the root() watcher in login.js — SERVER.SELECT_REQUEST cancels handleLoginSuccess; 2s timeout does not.
  • Subsequent passes: high-traffic sagas (init.js, selectServer.ts, rooms.js).

Non-goals

  • Not aiming for 100% saga coverage. Pick the seams where regressions are most costly (auth, server switch, deep links, rooms sync).
Lingua principale
TypeScript
Stelle
2.4k
Fork
1.5k
Merge medio
1g 15h
PR unite (30g)
29

Preparare l'ambiente

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 RocketChat/Rocket.Chat.ReactNative

Tutte le issue di RocketChat/Rocket.Chat.ReactNative

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.