From e4d56565c19ff500c407420befd98fe4a0a4c039 Mon Sep 17 00:00:00 2001 From: Matt Miller Date: Mon, 29 Jun 2026 11:46:43 -0700 Subject: [PATCH] test: assert concrete 500 status on the transient history error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/stores/assetsStore.test.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/stores/assetsStore.test.ts b/src/stores/assetsStore.test.ts index 9a094a4d9e..53edb6da23 100644 --- a/src/stores/assetsStore.test.ts +++ b/src/stores/assetsStore.test.ts @@ -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