fix: clear re-match selection when searching again
This commit is contained in:
@@ -110,4 +110,21 @@ describe('ItemPage', () => {
|
||||
await waitFor(() => expect(api.deleteItem).toHaveBeenCalledWith(1))
|
||||
await waitFor(() => expect(screen.getByText('library')).toBeTruthy())
|
||||
})
|
||||
|
||||
it('re-match clears the picked album when searching again', async () => {
|
||||
vi.mocked(api.searchAlbums)
|
||||
.mockResolvedValueOnce({
|
||||
albums: [{ id: 77, subsonicId: 'a1', title: 'Motion (Remaster)', artist: 'The Cinematic Orchestra' }],
|
||||
} as never)
|
||||
.mockResolvedValueOnce({
|
||||
albums: [{ id: 88, subsonicId: 'a2', title: 'Something Else', artist: 'Other Artist' }],
|
||||
} as never)
|
||||
renderItem()
|
||||
await userEvent.click(await screen.findByRole('button', { name: /re-match/i }))
|
||||
await userEvent.click(screen.getByRole('button', { name: /^search$/i }))
|
||||
await userEvent.click(await screen.findByRole('radio', { name: /motion \(remaster\)/i }))
|
||||
await userEvent.click(screen.getByRole('button', { name: /^search$/i }))
|
||||
const linkBtn = await screen.findByRole('button', { name: /^link$/i })
|
||||
expect(linkBtn).toHaveProperty('disabled', true)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user