Skip to content

Add unit-test coverage for app/sagas/ #7341

Description

@diegolmello

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.jsSERVER.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).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions