1
0

fix: reset-to-auto in both rip branches, visible mutation failures, distinct invalid-token error

This commit is contained in:
2026-09-03 19:24:57 +02:00
parent f2fff1d7be
commit 21a4c69972
6 changed files with 101 additions and 24 deletions

View File

@@ -177,4 +177,12 @@ describe('ScanPage flow', () => {
await waitFor(() => expect(screen.getByText(/added to collection/i)).toBeTruthy())
expect(api.addToCollection).toHaveBeenCalledTimes(1)
})
it('distinguishes an invalid discogs token with a settings link', async () => {
vi.mocked(api.lookupBarcode).mockRejectedValue(new ApiError(502, 'discogs_auth'))
renderScan()
await userEvent.click(screen.getByRole('button', { name: 'fake-scan' }))
await waitFor(() => expect(screen.getByText(/rejected your token/i)).toBeTruthy())
expect(screen.getByRole('link', { name: /settings/i }).getAttribute('href')).toBe('/settings')
})
})