fix(stats): open game detail pages from stat lists, perfect games clickable

Add perfect games click-through on the dashboard. Remove Steam store
links from game lists. Stat numbers with count 0 are not clickable.
Tests cover the perfect-games click, zero guards, and owner versus
visitor behavior.
This commit is contained in:
lobo committed 2026-10-04 10:07:27 +02:00
1 parent 777ba87fd6
commit 8b94a25844
27 files changed
+270 -51

No files matched your search

+28
View File
@@ -113,6 +113,34 @@ describe('StatsPage', () => {
expect(link.getAttribute('href')).toBe('/library?hideDuplicates=true&status=BACKLOG');
});
it('aZeroTileIsNotClickable', async () => {
const base = stats();
answerStats(json(200, stats({overview: {...base.overview, neverStarted: 0}})));
renderPage();
await screen.findByText('STATS.OVERVIEW.NEVER_STARTED');
expect(screen.queryByRole('button', {name: /STATS\.OVERVIEW\.NEVER_STARTED/})).toBeNull();
});
it('zeroCountsAreNotClickableInPileHabitsAndStatuses', async () => {
const base = stats();
answerStats(json(200, stats({
overview: {...base.overview, byStatus: {...base.overview.byStatus, DROPPED: 0}},
pile: {...base.pile, backlogGames: 0, gamesWithTimeToBeat: 0},
habits: {...base.habits, underOneHourGames: 0},
})));
renderPage();
await screen.findByText('STATS.PILE.GAMES');
for (const name of [/STATS\.PILE\.GAMES/, /STATS\.PILE\.NORMAL/, /STATS\.HABITS\.UNDER_ONE_HOUR/, /BACKLOG\.STATUS\.DROPPED: 0/]) {
expect(screen.queryByRole('button', {name})).toBeNull();
expect(screen.queryByRole('link', {name})).toBeNull();
}
expect(screen.getByRole('link', {name: 'BACKLOG.STATUS.PLAYING: 3'})).toBeTruthy();
});
it('leavesTheMoonTripsAlone', async () => {
answerStats(json(200, stats()));
renderPage();