Public Access
feat(library): show playtime per platform on game detail
Hero and library card show the set total. Fall back to the row's own minutes when the API sends no total.
This commit is contained in:
1 parent
16651a1f56
commit
f1a6bc0443
9 files changed
+178
-2
No files matched your search
@@ -235,6 +235,16 @@ describe('GameLibrary short games', () => {
|
||||
expect(screen.queryByText('Steam')).toBeNull();
|
||||
});
|
||||
|
||||
it('showsTheSetTotalPlaytimeOnTheCard_AndTheOwnMinutesWithoutATotal', async () => {
|
||||
answer([{appid: 220, name: 'Half-Life 2', playtimeMinutes: 600, totalPlaytimeMinutes: 3600, status: 'BACKLOG'},
|
||||
{appid: 620, name: 'Portal 2', playtimeMinutes: 1200, status: 'BACKLOG'}]);
|
||||
renderLibrary();
|
||||
|
||||
expect(await screen.findByText('60h')).toBeTruthy();
|
||||
expect(screen.getByText('20h')).toBeTruthy();
|
||||
expect(screen.queryByText('10h')).toBeNull();
|
||||
});
|
||||
|
||||
it('leaves the hidden games with a status click', async () => {
|
||||
const lib = renderLibrary('/library?hidden=true');
|
||||
await waitFor(() => expect(fetch).toHaveBeenCalled());
|
||||
|
||||
Reference in new issue
Block a user