Skip to content

[Testing] pushNotifications.ts stub implementations cause integration tests to always pass incorrectly #837

Description

@RUKAYAT-CODER

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

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbugSomething isn't workingenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions