Add unit-test coverage for app/sagas/

Đang mở
#7,341 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
70/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
javascript, react-native, typescript
Lĩnh vực
mobile-dev, testing

Hướng nghiên cứu

Bắt đầu với các test hiện có trong app/sagas/tests/videoConf.voipBlock.test.ts và deepLinking.test.ts, sau đó kiểm tra app/sagas/login.js cùng watcher root() của nó. Thiết lập harness runSaga hoặc expectSaga được đề xuất và bao phủ các trường hợp SERVER.SELECT_REQUEST và timeout. Hoàn tất khi hành vi của watcher root() được assert và các test mới đều pass.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

✅ 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).
Ngôn ngữ chính
TypeScript
Star
2.4k
Fork
1.5k
Merge trung bình
1 ngày 15 giờ
Pull request đã merge (30 ngày)
29

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của RocketChat/Rocket.Chat.ReactNative

Tất cả issue của RocketChat/Rocket.Chat.ReactNative

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.