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.
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
frontend/src/api.tsrequest behavior through exported API functions.