1
0

feat: rip queue page, library stats/queue links and on-loan chip

This commit is contained in:
2026-09-03 22:59:31 +02:00
parent 47858b1788
commit fc5797d929
5 changed files with 159 additions and 1 deletions

View File

@@ -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() }))
)
})
})