Skip to content

Commit

Permalink
chore: del story for form (#1071)
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaCG authored Nov 11, 2024
1 parent 3ea0cdb commit 04f02b5
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 36 deletions.
29 changes: 1 addition & 28 deletions src/blocks/Form/__stories__/Form.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,11 @@ import {v4 as uuidv4} from 'uuid';

import {yfmTransform} from '../../../../.storybook/utils';
import {PageConstructor} from '../../../containers/PageConstructor';
import {
ContentItemProps,
FormBlockDirection,
FormBlockModel,
isHubspotDataForm,
} from '../../../models';
import {FormBlockDirection, FormBlockModel, isHubspotDataForm} from '../../../models';
import FormBlock from '../Form';

import data from './data.json';

const transformedContentList = data.list.map((item) => {
return {
...item,
text: item?.text && yfmTransform(item.text),
};
}) as ContentItemProps[];

export default {
title: 'Blocks/Form',
component: FormBlock,
Expand Down Expand Up @@ -58,20 +46,6 @@ const DefaultTemplate: StoryFn<FormBlockModel> = (args) => (
/>
);

const WithContentListTemplate: StoryFn<FormBlockModel> = (args) => (
<PageConstructor
content={{
blocks: [
{
...args,
formData: __getFormData(args.formData),
textContent: {list: transformedContentList, title: 'WithContentList'},
},
],
}}
/>
);

const ContentDirectionTemplate: StoryFn<FormBlockModel> = (args) => (
<PageConstructor
content={{
Expand Down Expand Up @@ -119,7 +93,6 @@ export const WithBackgroundColor = ContentDirectionTemplate.bind({});
export const WithBackgroundImage = ContentDirectionTemplate.bind({});
export const DarkTheme = ContentDirectionTemplate.bind({});
export const FormData = FormDataTemplate.bind({});
export const WithContentList = WithContentListTemplate.bind({});

WithBackgroundColor.args = data.withBackground;

Expand Down
7 changes: 0 additions & 7 deletions src/blocks/Form/__tests__/Form.visual.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
FormData,
WithBackgroundColor,
WithBackgroundImage,
WithContentList,
} from './helpers';

const DEFAULT_FORM_DELAY = 20 * 1000;
Expand Down Expand Up @@ -50,10 +49,4 @@ test.describe('Form', () => {
await delay(DEFAULT_FORM_DELAY);
await expectScreenshot({skipTheme: 'dark'});
});

test('render stories <WithContentList>', async ({mount, expectScreenshot, delay}) => {
await mount(<WithContentList />);
await delay(DEFAULT_FORM_DELAY);
await expectScreenshot({skipTheme: 'dark'});
});
});
1 change: 0 additions & 1 deletion src/blocks/Form/__tests__/helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ export const {
WithBackgroundImage,
DarkTheme,
FormData,
WithContentList,
} = composeStories(FormStories);

0 comments on commit 04f02b5

Please sign in to comment.