From 23a30e2ab21c2e0212fba3e839d8fc9b6f31454b Mon Sep 17 00:00:00 2001 From: sureshHARDIYA Date: Wed, 15 Mar 2017 14:38:43 +0100 Subject: [PATCH] Add onClick props in storybook This reason, users clicked on button and did not see any action, now it logs the action --- .storybook/config.js | 10 +++++----- src/__tests__/Dropdown-test.js | 1 - src/stories/Button.js | 12 ++++++------ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/.storybook/config.js b/.storybook/config.js index 7c855c67..bbee2891 100644 --- a/.storybook/config.js +++ b/.storybook/config.js @@ -42,12 +42,12 @@ addDecorator((fn, { kind, story }) =>
- test + var script = document.createElement('script'); + script.setAttribute('src', 'https://getuikit.com/migrate.min.js'); + document.body.appendChild(script); + `}>test */} {fn()}
) diff --git a/src/__tests__/Dropdown-test.js b/src/__tests__/Dropdown-test.js index 84526175..e9c7ef5c 100644 --- a/src/__tests__/Dropdown-test.js +++ b/src/__tests__/Dropdown-test.js @@ -1,5 +1,4 @@ import renderer from 'react-test-renderer' - import Dropdown from '../Dropdown' jest.useFakeTimers() diff --git a/src/stories/Button.js b/src/stories/Button.js index 99910861..6f80bd87 100644 --- a/src/stories/Button.js +++ b/src/stories/Button.js @@ -1,4 +1,4 @@ -import { storiesOf } from '@kadira/storybook' +import { storiesOf, action } from '@kadira/storybook' import { Button } from 'uikit-react' // This is to work around: https://github.com/kadirahq/react-storybook-addon-info/issues/26#issuecomment-229029177 @@ -7,10 +7,10 @@ Button.displayName = 'Button' storiesOf('Button', module) .addWithInfo('Basic Usage', '', () => (
-   -   -   -   - +   +   +   +   +
), { header: false, inline: true, propTables: [Button] })