feat: rip queue page, library stats/queue links and on-loan chip
This commit is contained in:
@@ -110,4 +110,23 @@ describe('LibraryPage', () => {
|
||||
await waitFor(() => expect(screen.getByText(/nothing here yet/i)).toBeTruthy())
|
||||
expect(screen.getByRole('link', { name: /add your first record/i }).getAttribute('href')).toBe('/add')
|
||||
})
|
||||
|
||||
it('header links to stats and queue', async () => {
|
||||
renderLibrary()
|
||||
expect(screen.getByRole('link', { name: /stats/i }).getAttribute('href')).toBe('/stats')
|
||||
expect(screen.getByRole('link', { name: /queue/i }).getAttribute('href')).toBe('/queue')
|
||||
})
|
||||
|
||||
it('on-loan chip filters by loan state', async () => {
|
||||
renderLibrary()
|
||||
await waitFor(() => expect(screen.getByRole('button', { name: /^on loan$/i })).toBeTruthy())
|
||||
await userEvent.click(screen.getByRole('button', { name: /^on loan$/i }))
|
||||
await waitFor(() =>
|
||||
expect(api.listCollection).toHaveBeenLastCalledWith(expect.objectContaining({ onLoan: 'true' }))
|
||||
)
|
||||
await userEvent.click(screen.getByRole('button', { name: /^on loan$/i }))
|
||||
await waitFor(() =>
|
||||
expect(api.listCollection).toHaveBeenLastCalledWith(expect.not.objectContaining({ onLoan: expect.anything() }))
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user