Public Access
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:
1 parent
777ba87fd6
commit
8b94a25844
27 files changed
+270
-51
No files matched your search
@@ -128,4 +128,31 @@ describe('StatGamesDialog', () => {
|
||||
expect(screen.queryByText('Old game')).toBeNull();
|
||||
expect(screen.getByText('New game')).toBeTruthy();
|
||||
});
|
||||
|
||||
it('aProfileRowIsPlainForAVisitor', async () => {
|
||||
fetchRoutes({'GET /api/public/profiles/library/stats/games': page(rows(1, 1), 0, 1, 1)});
|
||||
renderDialog({source: 'profile', ticket: 't'});
|
||||
|
||||
await screen.findByText('Game 1');
|
||||
|
||||
expect(screen.queryByRole('link')).toBeNull();
|
||||
});
|
||||
|
||||
it('aProfileRowOpensTheDetailPageForTheOwner', async () => {
|
||||
fetchRoutes({'GET /api/public/profiles/library/stats/games': page(rows(1, 1), 0, 1, 1)});
|
||||
renderDialog({source: 'profile', ticket: 't', linked: true});
|
||||
|
||||
const link = await screen.findByRole('link', {name: /Game 1/});
|
||||
|
||||
expect(link.getAttribute('href')).toBe('/library/1');
|
||||
});
|
||||
|
||||
it('aCommunityRowIsPlain', async () => {
|
||||
fetchRoutes({'GET /api/stats/public/games': page(rows(1, 1, {libraries: 2, minutes: 60}), 0, 1, 1)});
|
||||
renderDialog({source: 'community'});
|
||||
|
||||
await screen.findByText('Game 1');
|
||||
|
||||
expect(screen.queryByRole('link')).toBeNull();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user