Skip to content

[TEST] Add API client tests for request timeout and abort behavior #471

@utksh1

Description

@utksh1

Problem

The frontend API helper owns request timeout and abort behavior, but there is no focused coverage for timeout cleanup, abort propagation, or non-OK HTTP errors.

Expected behavior

The API helper should have direct unit tests for timeout/abort and failed response paths so future fetch changes do not regress cleanup or error handling.

Acceptance criteria

  • Add tests around frontend/src/api.ts request behavior through exported API functions.
  • Cover a successful response, a non-OK response, and an aborted/timeout path.
  • Use fake timers where appropriate and restore mocked fetch/timers after each test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:frontendFrontend React/UI worklevel:intermediate35 pts difficulty label for moderate contributor PRspriority:mediumImportant issue with normal urgencytype:testingTesting work category bonus label

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions