test: assert concrete 500 status on the transient history error

Locks the recover-vs-not classification — only a JobsApiError with
status 400 drops to the offset fallback; a 500 must surface as a
recorded error without resetting the cursor.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Matt Miller
2026-06-29 11:46:43 -07:00
parent 007a5cce8e
commit e4d56565c1

View File

@@ -754,9 +754,12 @@ describe('assetsStore - Refactored (Option A)', () => {
await store.updateHistory()
await store.loadMoreHistory()
// No offset fallback for transient failures, just a recorded error
// No offset fallback for transient failures, just a recorded error.
// Asserting the concrete 500 guards the recover-vs-not classification:
// only a 400 should drop to the offset fallback.
expect(fetchHistoryPage).toHaveBeenCalledTimes(2)
expect(store.historyError).toBeInstanceOf(Error)
expect(store.historyError).toBeInstanceOf(JobsApiError)
expect(store.historyError).toMatchObject({ status: 500 })
expect(store.hasMoreHistory).toBe(true)
// The still-valid cursor is retried on the next attempt