Skip to content

Commit

Permalink
test: add mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
acid-chicken committed Apr 8, 2023
1 parent cfcc4d5 commit 127be7e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions packages/frontend/src/pages/user/home.stories.impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,19 @@ export const Default = {
},
}));
}),
rest.get('/api/charts/user/pv', (req, res, ctx) => {
const length = Math.max(Math.min(parseInt(req.url.searchParams.get('limit') ?? '30', 10), 1), 300);
return res(ctx.json({
upv: {
user: Array.from({ length }, () => 0),
visitor: Array.from({ length }, () => 0),
},
pv: {
user: Array.from({ length }, () => 0),
visitor: Array.from({ length }, () => 0),
},
}));
}),
],
},
chromatic: {
Expand Down

1 comment on commit 127be7e

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chromatic will skip testing but you may still have to review the changes on Chromatic.

Please sign in to comment.