Skip to content

[Testing] axios.config.ts error branch coverage missing for SSL pin, 401, 403, 409, and 429 paths #838

Description

@RUKAYAT-CODER

Overview

The axios interceptor in axios.config.ts has multiple complex error handling branches (SSL pin failure, 401 refresh, 403 forbidden, 409 conflict, 429 rate limit), none of which are covered by automated tests.

Specifications

Features:

  • Write a test for each error branch
  • Mock axios responses for each HTTP status code
  • Verify the correct action is taken (logout, retry, queue, etc.)

Tasks:

  • Create __tests__/axios.config.test.ts
  • Add test cases for 401 (first retry, max retries), 403, 409, 429, SSL failure, network timeout
  • Assert correct side effects (Sentry calls, navigation, queue additions)

Impacted Files:

  • src/config/axios.config.ts
  • __tests__/axios.config.test.ts (new)

Acceptance Criteria

  • All error branches have at least one test
  • Code coverage for axios.config.ts > 80%
  • Tests run in CI without network access (fully mocked)

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions