feat(library): time to beat, short-games filter and backlog hours

This commit is contained in:
lobo committed 2026-09-24 14:40:41 +02:00
1 parent fd343da4be
commit 91d5672421
11 files changed
+131 -11

No files matched your search

+13
View File
@@ -102,3 +102,16 @@ describe('GameLibrary sort', () => {
expect(new URL(fetch.mock.calls[0][0], 'http://x').searchParams.get('sort')).toBe(sort);
});
});
describe('GameLibrary short games', () => {
it('filters by time to beat and keeps the chip state in the URL', async () => {
const lib = renderLibrary();
await waitFor(() => expect(fetch).toHaveBeenCalled());
fireEvent.click(screen.getByRole('button', {name: 'LIBRARY.FILTER_SHORT'}));
await waitFor(() => expect(lib.params().get('maxMinutes')).toBe('600'));
await waitFor(() => expect(fetch.mock.calls.at(-1)[0]).toMatch(/[?&]maxMinutes=600(&|$)/));
expect(screen.getByRole('button', {name: 'LIBRARY.FILTER_SHORT'}).getAttribute('aria-pressed')).toBe('true');
});
});