Skip to content

Commit

Permalink
fix: storybook and test for row block
Browse files Browse the repository at this point in the history
  • Loading branch information
brunocezar-tlf committed Jul 7, 2023
1 parent ec64bb1 commit 7f2c4c9
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 24 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,10 @@ test.each`
expect(image).toMatchImageSnapshot();
});

test.each`
stackingGroup
${false} | ${true}
`('Blocks Row Block', async ({stackingGroup}) => {
test('Blocks Row Block', async () => {
await openStoryPage({
id: 'community-blocks--block-row',
device: 'MOBILE_IOS',
args: {stackingGroup},
});

const stepper = await screen.findByTestId('row-block');
Expand Down
44 changes: 25 additions & 19 deletions src/community/__stories__/blocks-story.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import {Avatar, Image, Box, ResponsiveLayout, StackingGroup, Tag} from '../..';
import {Avatar, Image, Box, ResponsiveLayout, StackingGroup, Tag, Stack} from '../..';
import {
HighlightedValueBlock,
InformationBlock,
Expand Down Expand Up @@ -28,23 +28,29 @@ type RowBlockArgs = {
export const BlockRow: StoryComponent<RowBlockArgs> = ({title, description, stackingGroup}) => {
return (
<ResponsiveLayout>
<Box paddingY={24} dataAttributes={{testid: 'row-block'}}>
<RowBlock
title={title}
description={description}
stackingGroup={
stackingGroup ? (
<StackingGroup stacked maxItems={3} moreItemsStyle={{type: 'circle', size: 40}}>
<Avatar size={40} src={imgExample} />
<Avatar size={40} src={imgExample} />
<Avatar size={40} src={imgExample} />
<Avatar size={40} src={imgExample} />
<Avatar size={40} src={imgExample} />
<Avatar size={40} src={imgExample} />
</StackingGroup>
) : undefined
}
/>
<Box paddingY={24}>
<Stack space={24} dataAttributes={{testid: 'row-block'}}>
<RowBlock
title={title}
stackingGroup={
stackingGroup ? (
<StackingGroup
stacked
maxItems={3}
moreItemsStyle={{type: 'circle', size: 40}}
>
<Avatar size={40} src={imgExample} />
<Avatar size={40} src={imgExample} />
<Avatar size={40} src={imgExample} />
<Avatar size={40} src={imgExample} />
<Avatar size={40} src={imgExample} />
<Avatar size={40} src={imgExample} />
</StackingGroup>
) : undefined
}
/>
<RowBlock title={title} description={description} />
</Stack>
</Box>
</ResponsiveLayout>
);
Expand All @@ -54,7 +60,7 @@ BlockRow.storyName = 'RowBlock';
BlockRow.args = {
title: 'title',
description: 'description',
stackingGroup: false,
stackingGroup: true,
};

type SimpleBlockArgs = {
Expand Down

0 comments on commit 7f2c4c9

Please sign in to comment.