Add tests and raise coverage on pages (#2180)

* Add tests and raise coverage on pages

* Fix lint
This commit is contained in:
Charles Bochet
2023-10-21 20:09:08 +02:00
committed by GitHub
parent f1670f0cf4
commit 1954ed5e3a
11 changed files with 101 additions and 14 deletions

View File

@ -0,0 +1,34 @@
import { Meta, StoryObj } from '@storybook/react';
import { AppPath } from '@/types/AppPath';
import {
PageDecorator,
PageDecoratorArgs,
} from '~/testing/decorators/PageDecorator';
import { graphqlMocks } from '~/testing/graphqlMocks';
import { sleep } from '~/testing/sleep';
import { ImpersonateEffect } from '../ImpersonateEffect';
const meta: Meta<PageDecoratorArgs> = {
title: 'Pages/Impersonate/Impersonate',
component: ImpersonateEffect,
decorators: [PageDecorator],
args: {
routePath: AppPath.Impersonate,
routeParams: { ':userId': '1' },
},
parameters: {
msw: graphqlMocks,
},
};
export default meta;
export type Story = StoryObj<typeof ImpersonateEffect>;
export const Default: Story = {
play: async ({}) => {
await sleep(100);
},
};