feat(achievements): dashboard card, library badge, 100 % hint and profile stats

This commit is contained in:
lobo committed 2026-09-25 10:13:31 +02:00
1 parent 2efdf64675
commit 085fcf15a4
14 files changed
+369 -19

No files matched your search

+9
View File
@@ -56,6 +56,8 @@ describe('Dashboard', () => {
if (url.includes('/api/library/activity')) return ok({totalMinutes: 90, days: [{day: '2026-09-23', minutes: 0}, {day: '2026-09-24', minutes: 90}], recentGames: [
{appid: 1086940, name: "Baldur's Gate 3", playtimeMinutes: 900, playtime2Weeks: 90, status: 'PLAYING'}]});
if (url.includes('/api/library/games-count')) return ok({count: 1, hasSteamId: true});
if (url.includes('/api/library/achievements/summary')) return ok({unlocked: 24, startedGames: 4, perfectGames: 2,
averageCompletion: 71.3, pendingGames: 0, hiddenGames: 0, closest: []});
return ok({content: [], total: 0, byStatus: {}});
});
return render(
@@ -72,6 +74,13 @@ describe('Dashboard', () => {
expect(container.querySelector('img[src$="/1086940/library_hero.jpg"]')).not.toBeNull();
});
it('shows the achievement summary', async () => {
mockDashboard();
expect(await screen.findByText('DASHBOARD.ACHIEVEMENTS.TITLE')).toBeTruthy();
expect(screen.getByText('71,3 %')).toBeTruthy();
});
it('shows the picked banner game instead', async () => {
localStorage.setItem('tbp_appearance', JSON.stringify({bannerAppid: 620}));
const container = mockDashboard();