@ -1,16 +1,12 @@
|
||||
import { getOperationName } from '@apollo/client/utilities';
|
||||
import { Meta, StoryObj } from '@storybook/react';
|
||||
import { within } from '@storybook/test';
|
||||
import { graphql } from 'msw';
|
||||
|
||||
import { AppPath } from '@/types/AppPath';
|
||||
import {
|
||||
PageDecorator,
|
||||
PageDecoratorArgs,
|
||||
} from '~/testing/decorators/PageDecorator';
|
||||
import { mockedOnboardingUsersData } from '~/testing/mock-data/users';
|
||||
|
||||
import { GET_CURRENT_USER } from '../../../modules/users/graphql/queries/getCurrentUser';
|
||||
import { CreateProfile } from '../CreateProfile';
|
||||
|
||||
const meta: Meta<PageDecoratorArgs> = {
|
||||
@ -18,20 +14,7 @@ const meta: Meta<PageDecoratorArgs> = {
|
||||
component: CreateProfile,
|
||||
decorators: [PageDecorator],
|
||||
args: { routePath: AppPath.CreateProfile },
|
||||
parameters: {
|
||||
msw: [
|
||||
graphql.query(
|
||||
getOperationName(GET_CURRENT_USER) ?? '',
|
||||
(req, res, ctx) => {
|
||||
return res(
|
||||
ctx.data({
|
||||
currentUser: mockedOnboardingUsersData[1],
|
||||
}),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
},
|
||||
parameters: {},
|
||||
};
|
||||
|
||||
export default meta;
|
||||
|
||||
@ -1,16 +1,12 @@
|
||||
import { getOperationName } from '@apollo/client/utilities';
|
||||
import { Meta, StoryObj } from '@storybook/react';
|
||||
import { within } from '@storybook/test';
|
||||
import { graphql } from 'msw';
|
||||
|
||||
import { AppPath } from '@/types/AppPath';
|
||||
import {
|
||||
PageDecorator,
|
||||
PageDecoratorArgs,
|
||||
} from '~/testing/decorators/PageDecorator';
|
||||
import { mockedOnboardingUsersData } from '~/testing/mock-data/users';
|
||||
|
||||
import { GET_CURRENT_USER } from '../../../modules/users/graphql/queries/getCurrentUser';
|
||||
import { CreateWorkspace } from '../CreateWorkspace';
|
||||
|
||||
const meta: Meta<PageDecoratorArgs> = {
|
||||
@ -19,18 +15,7 @@ const meta: Meta<PageDecoratorArgs> = {
|
||||
decorators: [PageDecorator],
|
||||
args: { routePath: AppPath.CreateWorkspace },
|
||||
parameters: {
|
||||
msw: [
|
||||
graphql.query(
|
||||
getOperationName(GET_CURRENT_USER) ?? '',
|
||||
(req, res, ctx) => {
|
||||
return res(
|
||||
ctx.data({
|
||||
currentUser: mockedOnboardingUsersData[0],
|
||||
}),
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
msw: [],
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user