Skip to content

Commit

Permalink
Update exercise0/storybook with an answer file
Browse files Browse the repository at this point in the history
  • Loading branch information
marcysutton committed May 12, 2022
1 parent 0ace97d commit ccc2410
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
6 changes: 6 additions & 0 deletions exercise0-storybook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,9 @@ yarn storybook
Using the `ListingExcerpt.stories.jsx` file as a reference, create a
new story in the same directory for the `DropdownList` component.
It can be imported from the same directory as the `ListingExcerpt`.

You can peek at the answer in `answer/DropdownList.stories-test.jsx`. Be sure to
update the filename to exclude `-test` for it to show up in Storybook.

Once you have a story for the DropdownList component, you can do some manual testing
in isolation and make accessibility improvements to it.
19 changes: 19 additions & 0 deletions exercise0-storybook/answer/DropdownList.stories-test.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';

import DropdownList from 'components/dropdown-list';

export default {
title: 'Components/DropdownList',
component: DropdownList,
}

// We create a “template” of how args map to rendering
const Template = (args) => <DropdownList {...args} />;

// Each story then reuses that template
export const Default = Template.bind({});

Default.args = {
defaultItemText: 'Fruits',
items: ['apples', 'pears', 'plums']
};

0 comments on commit ccc2410

Please sign in to comment.