Overview
pushNotifications.ts registration stubs return true regardless of input. Integration tests that test the push registration flow always pass, even though the real backend registration is not implemented.
Specifications
Features:
- Replace stubs with a mockable implementation that can be controlled in tests
- Add integration tests that mock the backend endpoint and test both success and failure paths
Tasks:
- Implement the real registration call
- Add Jest mocks for the backend endpoint
- Write tests for: registration success, network failure, duplicate token, invalid token
Impacted Files:
src/services/pushNotifications.ts
__tests__/pushNotifications.test.ts
Acceptance Criteria
- Integration tests use real implementation paths with mocked HTTP
- Token registration failure is tested and handled
- Push tests do not pass when backend returns an error
Overview
pushNotifications.tsregistration stubs returntrueregardless of input. Integration tests that test the push registration flow always pass, even though the real backend registration is not implemented.Specifications
Features:
Tasks:
Impacted Files:
src/services/pushNotifications.ts__tests__/pushNotifications.test.tsAcceptance Criteria