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

+18
View File
@@ -43,6 +43,15 @@ describe('LandingPage', () => {
}
});
it('topGamesHaveNoStoreLink', async () => {
answer({topPlayedGames: [{appid: 220, name: 'Half-Life 2', value: 600}]});
const {container} = renderPage();
await screen.findByText('Half-Life 2');
expect(container.querySelector('a[href*="steampowered"]')).toBeNull();
});
it('opensTheGamesBehindTheTotalButNotBehindOneUsersLibrary', async () => {
fetchRoutes({
'GET /api/stats/public': json(200, {topPlayedGames: [], topOwnedGames: [], totalLibraryEntries: 9, biggestLibrary: 4}),
@@ -58,4 +67,13 @@ describe('LandingPage', () => {
expect(screen.queryByRole('button', {name: /LANDING\.BIGGEST_LIBRARY/})).toBeNull();
expect(screen.queryByRole('button', {name: /LANDING\.TOTAL_USERS/})).toBeNull();
});
it('aZeroTotalIsNotClickable', async () => {
answer({totalLibraryEntries: 0});
renderPage();
await screen.findByText('LANDING.TOTAL_GAMES');
expect(screen.queryByRole('button', {name: /LANDING\.TOTAL_GAMES/})).toBeNull();
});
});