Skip to content

Commit

Permalink
fix: add data-testid props
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Apr 28, 2021
1 parent ee3f298 commit c50907a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
7 changes: 6 additions & 1 deletion ui/blocks/src/Stories/Stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ export const Stories: FC<StoriesProps> = ({ id, name, title, ...rest }) => {
return null;
}
return (
<StoryBlockContainer story={story} title={title} {...rest}>
<StoryBlockContainer
story={story}
title={title}
data-testid="stories"
{...rest}
>
{stories.map((id: string) => {
const story = store.stories[id];
return (
Expand Down
2 changes: 1 addition & 1 deletion ui/blocks/src/Story/Story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const Story: FC<StoryProps> = forwardRef(function Story(
const story = useStory({ id, name });
if (story && story.id && story.renderFn) {
return (
<StoryBlockContainer {...rest} story={story}>
<StoryBlockContainer {...rest} data-testid="story" story={story}>
<StoryRender
ref={ref}
story={story}
Expand Down
2 changes: 1 addition & 1 deletion ui/blocks/src/StoryConfig/StoryConfig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const StoryConfig: FC<StoryConfigProps> = ({
const doc = useCurrentDocument();
const docPackage = usePackage(doc?.package);
return (
<StoryBlockContainer story={story} {...rest}>
<StoryBlockContainer data-testid="story-config" story={story} {...rest}>
<BaseStoryConfig
story={story}
doc={doc}
Expand Down
2 changes: 1 addition & 1 deletion ui/blocks/src/StorySource/StorySource.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const StorySource: FC<StorySourceProps> = ({
const docPackage = usePackage(doc?.package);

return (
<StoryBlockContainer story={story} {...rest}>
<StoryBlockContainer story={story} data-testid="story-source" {...rest}>
<BaseStorySource
story={story}
doc={doc}
Expand Down

0 comments on commit c50907a

Please sign in to comment.