fix: reset-to-auto in both rip branches, visible mutation failures, distinct invalid-token error
This commit is contained in:
@@ -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')
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user