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)
Overview
The axios interceptor in
axios.config.tshas 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:
Tasks:
__tests__/axios.config.test.tsImpacted Files:
src/config/axios.config.ts__tests__/axios.config.test.ts(new)Acceptance Criteria
axios.config.ts> 80%