Skip to content

Commit

Permalink
feat(space): fix dataTestId (#625)
Browse files Browse the repository at this point in the history
  • Loading branch information
redzumi committed Apr 26, 2021
1 parent e88c15f commit a33ca6b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/space/src/Component.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export const SIZES = ['s', 'm', 'l', 8, 72];
wrap={boolean('wrap')}
divider={text('divider')}
fullWidth={boolean('fullWidth')}
dataTestId={text('dataTestId', 'testIdSpace')}
>
<Input placeholder='Над вишней в цвету' />
<Input placeholder='Спряталась за облака' />
Expand Down
2 changes: 2 additions & 0 deletions packages/space/src/Component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export const Space = forwardRef<HTMLDivElement, SpaceProps>((props, ref) => {
wrap = false,
divider = false,
fullWidth = false,
dataTestId,
} = props;

const [horizontalSize, verticalSize] = React.useMemo(
Expand Down Expand Up @@ -128,6 +129,7 @@ export const Space = forwardRef<HTMLDivElement, SpaceProps>((props, ref) => {

return (
<div
data-test-id={dataTestId}
className={containerClassName}
style={{
...(wrap && { flexWrap: 'wrap', marginBottom: -verticalSize }),
Expand Down

0 comments on commit a33ca6b

Please sign in to comment.