Add storybook tests for User & Metadata loading (#5650)
### Description Add storybook tests for User & Metadata loading ### Refs #5590 ### Demo https://github.com/twentyhq/twenty/assets/140154534/2434fc50-8d95-420b-9f62-6fbdf43ce9e5 Fixes #5590 --------- Co-authored-by: gitstart-twenty <gitstart-twenty@users.noreply.github.com> Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: Thiago Nascimbeni <tnascimbeni@gmail.com>
This commit is contained in:
@ -1,4 +1,3 @@
|
||||
import { expect } from '@storybook/jest';
|
||||
import { Meta, StoryObj } from '@storybook/react';
|
||||
import { within } from '@storybook/test';
|
||||
|
||||
@ -6,7 +5,6 @@ import {
|
||||
PageDecorator,
|
||||
PageDecoratorArgs,
|
||||
} from '~/testing/decorators/PageDecorator';
|
||||
import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator';
|
||||
import { graphqlMocks } from '~/testing/graphqlMocks';
|
||||
|
||||
import { RecordIndexPage } from '../RecordIndexPage';
|
||||
@ -31,7 +29,6 @@ export default meta;
|
||||
export type Story = StoryObj<typeof RecordIndexPage>;
|
||||
|
||||
export const Default: Story = {
|
||||
decorators: [PrefetchLoadingDecorator],
|
||||
play: async ({ canvasElement }) => {
|
||||
const canvas = within(canvasElement);
|
||||
|
||||
@ -42,14 +39,3 @@ export const Default: Story = {
|
||||
await canvas.findByText('My Customs');
|
||||
},
|
||||
};
|
||||
|
||||
export const Loading: Story = {
|
||||
play: async ({ canvasElement }) => {
|
||||
const canvas = within(canvasElement);
|
||||
|
||||
expect(canvas.queryByText('People')).toBeNull();
|
||||
expect(canvas.queryByText('Opportunities')).toBeNull();
|
||||
expect(canvas.queryByText('Listings')).toBeNull();
|
||||
expect(canvas.queryByText('My Customs')).toBeNull();
|
||||
},
|
||||
};
|
||||
|
||||
@ -7,7 +7,6 @@ import {
|
||||
PageDecorator,
|
||||
PageDecoratorArgs,
|
||||
} from '~/testing/decorators/PageDecorator';
|
||||
import { PrefetchLoadingDecorator } from '~/testing/decorators/PrefetchLoadingDecorator';
|
||||
import { graphqlMocks } from '~/testing/graphqlMocks';
|
||||
import { mockedPeopleData } from '~/testing/mock-data/people';
|
||||
import { mockedWorkspaceMemberData } from '~/testing/mock-data/users';
|
||||
@ -84,7 +83,7 @@ export type Story = StoryObj<typeof RecordShowPage>;
|
||||
export const Default: Story = {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-ignore
|
||||
decorators: [PrefetchLoadingDecorator, PageDecorator],
|
||||
decorators: [PageDecorator],
|
||||
play: async ({ canvasElement }) => {
|
||||
const canvas = within(canvasElement);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user