mirror of
https://github.com/portainer/portainer.git
synced 2025-08-05 05:45:22 +02:00
chore(deps): upgrade to msw v2 [EE-6489] (#10911)
This commit is contained in:
parent
ecd603db8c
commit
400a80c07d
19 changed files with 2602 additions and 1669 deletions
|
@ -1,6 +1,6 @@
|
|||
import { Meta } from '@storybook/react';
|
||||
import { Form, Formik } from 'formik';
|
||||
import { rest } from 'msw';
|
||||
import { http, HttpResponse } from 'msw';
|
||||
|
||||
import { withUserProvider } from '@/react/test-utils/withUserProvider';
|
||||
import { GitCredential } from '@/react/portainer/account/git-credentials/types';
|
||||
|
@ -14,28 +14,25 @@ export default {
|
|||
parameters: {
|
||||
msw: {
|
||||
handlers: [
|
||||
rest.get<Array<GitCredential>, { userId: string }>(
|
||||
http.get<{ userId: string }, Array<GitCredential>>(
|
||||
'/api/users/:userId/gitcredentials',
|
||||
(req, res, ctx) =>
|
||||
res(
|
||||
ctx.status(200),
|
||||
ctx.json<Array<GitCredential>>([
|
||||
{
|
||||
id: 1,
|
||||
name: 'credential-1',
|
||||
username: 'username-1',
|
||||
userId: parseInt(req.params.userId, 10),
|
||||
creationDate: 0,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: 'credential-2',
|
||||
username: 'username-2',
|
||||
userId: parseInt(req.params.userId, 10),
|
||||
creationDate: 0,
|
||||
},
|
||||
])
|
||||
)
|
||||
({ params }) =>
|
||||
HttpResponse.json([
|
||||
{
|
||||
id: 1,
|
||||
name: 'credential-1',
|
||||
username: 'username-1',
|
||||
userId: parseInt(params.userId, 10),
|
||||
creationDate: 0,
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: 'credential-2',
|
||||
username: 'username-2',
|
||||
userId: parseInt(params.userId, 10),
|
||||
creationDate: 0,
|
||||
},
|
||||
])
|
||||
),
|
||||
],
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue