mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 04:15:28 +02:00
refactor(app/tests): Make createMockUsers more deterministic [r8s-406] (#887)
This commit is contained in:
parent
db2e168540
commit
9f906b7417
5 changed files with 40 additions and 11 deletions
|
@ -2,9 +2,12 @@ import { http, HttpResponse } from 'msw';
|
|||
|
||||
import { TeamMembership } from '@/react/portainer/users/teams/types';
|
||||
import { createMockUsers } from '@/react-tools/test-mocks';
|
||||
import { Role } from '@/portainer/users/types';
|
||||
|
||||
export const userHandlers = [
|
||||
http.get('/api/users', async () => HttpResponse.json(createMockUsers(10))),
|
||||
http.get('/api/users', async () =>
|
||||
HttpResponse.json(createMockUsers(10, Role.Standard))
|
||||
),
|
||||
http.get<never, never, TeamMembership[]>(
|
||||
'/api/users/:userId/memberships',
|
||||
() => HttpResponse.json([])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue