Public Access
feat(stats): add chart form selection and pie, donut, line charts
Tag rows with 0 games are no longer clickable.
This commit is contained in:
1 parent
8b94a25844
commit
e054e13a59
21 files changed
+815
-56
No files matched your search
@@ -96,6 +96,21 @@ describe('Dashboard', () => {
|
||||
expect(fetch).toHaveBeenCalledWith(expect.stringMatching(/\/api\/library\/stats\?groups=HABITS,TREND$/), expect.anything());
|
||||
});
|
||||
|
||||
it('showsAStatTileInTheChartFormOfTheUser', async () => {
|
||||
fetchRoutes({
|
||||
...dashboardRoutes({dashboardTiles: [{id: 'STATS_FINISHED', size: 'M'}], statCharts: {FINISHED: 'LINE'}}),
|
||||
'GET /api/library/stats': json(200, {trend: null, finished: {finishedBeforeTracking: 0,
|
||||
perYear: [{year: 2022, games: 3}, {year: 2024, games: 1}]}}),
|
||||
});
|
||||
renderDashboard();
|
||||
|
||||
expect(await screen.findByRole('button', {name: /2022/})).toBeTruthy();
|
||||
expect(screen.getByRole('button', {name: /2024/})).toBeTruthy();
|
||||
expect(screen.getByText('2023: 0')).toBeTruthy();
|
||||
expect(screen.queryByRole('button', {name: /2023/})).toBeNull();
|
||||
expect(screen.queryByRole('group', {name: 'STATS.CHART.LABEL'})).toBeNull();
|
||||
});
|
||||
|
||||
it('leaves out a stat tile whose data did not come', async () => {
|
||||
const container = mockDashboard({dashboardTiles: [{id: 'STATS_PILE', size: 'M'}, {id: 'MOST_PLAYED', size: 'M'}]});
|
||||
|
||||
|
||||
Reference in new issue
Block a user