Skip to content

Commit

Permalink
add test for activities filters
Browse files Browse the repository at this point in the history
  • Loading branch information
Bricks666 committed Jul 6, 2024
1 parent 0e84ba7 commit bef7e88
Show file tree
Hide file tree
Showing 5 changed files with 1,198 additions and 14 deletions.
62 changes: 61 additions & 1 deletion configs/tests/mock-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,66 @@ const usersHandlers = [
}),
];

const handlers = [...authHandlers, ...invitationHandlers, ...usersHandlers];
const membersHandler = [
http.get('/api/members/:roomId', () => {
return HttpResponse.json({
data: users,
statusCode: 200,
});
}),
];

const actions = [
{
id: 1,
name: 'created',
},
{
id: 2,
name: 'updated',
},
{
id: 3,
name: 'removed',
},
];

const spheres = [
{
id: 1,
name: 'task',
},
{
id: 2,
name: 'comment',
},
{
id: 3,
name: 'tag',
},
];

const actionsHandlers = [
http.get('api/activities/actions/all', () => {
return HttpResponse.json({
data: actions,
statusCode: 200,
});
}),
http.get('api/activities/spheres/all', () => {
return HttpResponse.json({
data: spheres,
statusCode: 200,
});
}),
];

const handlers = [
...authHandlers,
...invitationHandlers,
...usersHandlers,
...actionsHandlers,
...membersHandler,
];

export const server = setupServer(...handlers);
Loading

0 comments on commit bef7e88

Please sign in to comment.