Skip to content

Commit

Permalink
Add List playground.
Browse files Browse the repository at this point in the history
To make sure item content doesn't exceed the list
  • Loading branch information
mendrew committed Jul 31, 2024
1 parent 1ae96a4 commit 716657b
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
35 changes: 35 additions & 0 deletions packages/vkui/src/components/List/List.e2e-playground.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { ComponentPlayground, type ComponentPlaygroundProps } from '@vkui-e2e/playground-helpers';
import { Avatar } from '../Avatar/Avatar';
import { Cell } from '../Cell/Cell';
import { List, ListProps } from './List';

export const ListPlayground = (props: ComponentPlaygroundProps) => {
return (
<ComponentPlayground
{...props}
propSets={[
{
gap: [0, 20],
},
]}
>
{(props: ListProps) => (
<div style={{ padding: 20 }}>
<List {...props}>
<Cell before={<Avatar />} draggable mode="removable">
Lorem
</Cell>
<Cell before={<Avatar />} draggable mode="removable">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud
exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure
dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt
mollit anim id est laborum.
</Cell>
</List>
</div>
)}
</ComponentPlayground>
);
};
7 changes: 7 additions & 0 deletions packages/vkui/src/components/List/List.e2e.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { test } from '@vkui-e2e/test';
import { ListPlayground } from './List.e2e-playground';

test('List', async ({ mount, expectScreenshotClippedToContent, componentPlaygroundProps }) => {
await mount(<ListPlayground {...componentPlaygroundProps} />);
await expectScreenshotClippedToContent();
});

0 comments on commit 716657b

Please sign in to comment.