Created
August 1, 2021 06:49
-
-
Save Goldziher/aae5ffd5a354a4096a1362551d4d9cc1 to your computer and use it in GitHub Desktop.
Example usage of Interface Forge factory in storybook
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Meta } from '@storybook/react'; | |
import { UserDTO } from '@shared/dto/User.dto'; | |
import { UserDTOFactory } from '@shared/factories/User.dto.factory'; | |
import React from 'react'; | |
import UserProfile from '@frontend/pages/user-profile'; | |
export default { | |
title: 'Users/Profile', | |
component: UserProfile, | |
} as Meta; | |
export const UserProfileStory = ({ | |
user, | |
}: { | |
user: UserDTO; | |
}): React.ReactElement => <UserProfile user={user} />; | |
UserProfileStory.args = { | |
user: UserDTOFactory.buildSync(), | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment