You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Testing] Zero test coverage for NotificationPreferencesScreen — toggle, quiet-hours, and all-disable paths #144
The notification system is v0.2-complete and directly tied to streak reminders, reward confirmations, and the prefsStore rehydration bug (Issue 8). NotificationPreferencesScreen is the only user-facing control for notification preferences, but it has no tests at all. Any regression in toggle persistence, quiet-hours validation, or the allEnabled master switch is invisible in CI.
A master enable/disable toggle backed by prefsStore.setAllEnabled
Per-type toggles for each NOTIFICATION_TYPES value backed by prefsStore.toggleType
Quiet-hours from/to time pickers backed by prefsStore.setQuietHours
Inline validation (from < to, valid HH:MM format)
None of these interactions have a test file. The nearest coverage is prefsStore.test.ts (which tests only the store, not the screen).
Key Challenges
The screen imports @notifee/react-native indirectly via prefsStore.toggleType (which cancels notifications asynchronously). The mock in __mocks__ or rn-modules.ts must be extended.
Quiet-hours validation involves parsing time strings; edge cases (midnight wrap 22:00–07:00, identical from/to) must be tested.
The component uses TouchableOpacity switches rather than platform Switch — fireEvent.press is the right interaction method.
Acceptance Criteria
Test file src/__tests__/NotificationPreferencesScreen.test.tsx created.
Tests cover: master toggle enables/disables all notifications, per-type toggle persists to store, quiet-hours update validates and persists, invalid time input shows an error.
All tests pass in CI with npm test.
Relevant files / functions
src/screens/NotificationPreferencesScreen.tsx
src/store/prefsStore.ts
src/__tests__/__mocks__/rn-modules.ts — add notifee mock if absent
Out of scope
Integration testing with the actual notification delivery system.
I'd like to work on this issue. I will add focused tests for the master and
per-type notification toggles, quiet-hours validation, persistence, and the
all-disabled state, following the existing test patterns. Please assign me if
this approach fits the campaign workflow.
Hi! I would like to work on this issue. I have solid experience with the stack and have successfully delivered multiple PRs across the campaign. I can start immediately and deliver a clean solution with full test coverage and lint checks. Could you please assign it to me? Thanks
I’ve worked with React Native + Jest/RNTL and Zustand (prefsStore pattern). I’ve already looked at NotificationPreferencesScreen.tsx and prefsStore.test.ts.
My plan: create src/tests/NotificationPreferencesScreen.test.tsx covering master toggle (setAllEnabled), per-type toggles (toggleType + persistence), quiet-hours setQuietHours with HH:MM validation including midnight wrap 22:00-07:00 and identical from/to, plus invalid input error display. I’ll extend the notifee mock in rn-modules.ts for the async cancel and use fireEvent.press for the TouchableOpacity switches as noted in the issue. No integration testing, and I’ll ensure npm test passes in CI.
Activity
dollarop commentedon Aug 28, 2026
I'd like to work on this issue. I will add focused tests for the master and
per-type notification toggles, quiet-hours validation, persistence, and the
all-disabled state, following the existing test patterns. Please assign me if
this approach fits the campaign workflow.
Santia2004 commentedon Aug 29, 2026
Hi! I would like to work on this issue. I have solid experience with the stack and have successfully delivered multiple PRs across the campaign. I can start immediately and deliver a clean solution with full test coverage and lint checks. Could you please assign it to me? Thanks
PASdeco commentedon Aug 29, 2026
Hi team, I'd love to take on #144.
I’ve worked with React Native + Jest/RNTL and Zustand (prefsStore pattern). I’ve already looked at NotificationPreferencesScreen.tsx and prefsStore.test.ts.
My plan: create src/tests/NotificationPreferencesScreen.test.tsx covering master toggle (setAllEnabled), per-type toggles (toggleType + persistence), quiet-hours setQuietHours with HH:MM validation including midnight wrap 22:00-07:00 and identical from/to, plus invalid input error display. I’ll extend the notifee mock in rn-modules.ts for the async cancel and use fireEvent.press for the TouchableOpacity switches as noted in the issue. No integration testing, and I’ll ensure npm test passes in CI.
Can start immediately if assigned, thanks!
grantfox-oss commentedon Aug 29, 2026
🦊 GrantFox — @PASdeco has been assigned to this issue as part of the Third Campaign campaign!
Next steps:
Closes #144)Good luck! Track your progress on GrantFox.
test(notifications): add coverage for NotificationPreferencesScreen —…
grantfox-oss commentedon Aug 30, 2026
🎉 This issue has been marked as completed on GrantFox as part of the Third Campaign campaign!
@PASdeco's PR #157 was approved and merged by @cybermax4200.
🏆 @PASdeco: You earned 35 FoxPoints for this contribution! Your current tier: Explorer (48 total points). Track your full progress on GrantFox.
👏 Great work, @PASdeco! Keep contributing to ecotask-network.