portainer/app/setup-tests/setup-handlers/users.ts

15 lines
453 B
TypeScript
Raw Normal View History

import { DefaultRequestBody, PathParams, rest } from 'msw';
import { TeamMembership } from '@/portainer/teams/types';
import { createMockUsers } from '@/react-tools/test-mocks';
export const userHandlers = [
rest.get('/api/users', async (req, res, ctx) =>
res(ctx.json(createMockUsers(10)))
),
rest.get<DefaultRequestBody, PathParams, TeamMembership[]>(
'/api/users/:userId/memberships',
(req, res, ctx) => res(ctx.json([]))
),
];