web: components: Moved story for MainButton + added base test
This commit is contained in:
parent
6089591019
commit
9aa96f6216
@ -2,7 +2,9 @@ import React from 'react';
|
|||||||
import { storiesOf } from '@storybook/react';
|
import { storiesOf } from '@storybook/react';
|
||||||
import { action } from '@storybook/addon-actions';
|
import { action } from '@storybook/addon-actions';
|
||||||
import { text, boolean, withKnobs, select } from '@storybook/addon-knobs/react';
|
import { text, boolean, withKnobs, select } from '@storybook/addon-knobs/react';
|
||||||
import { MainButton, DropDownItem, Icons } from 'asc-web-components';
|
import MainButton from '.';
|
||||||
|
import DropDownItem from '../drop-down-item';
|
||||||
|
import { Icons } from '../icons';
|
||||||
import Section from '../../../.storybook/decorators/section';
|
import Section from '../../../.storybook/decorators/section';
|
||||||
import withReadme from 'storybook-readme/with-readme';
|
import withReadme from 'storybook-readme/with-readme';
|
||||||
import Readme from './README.md';
|
import Readme from './README.md';
|
||||||
@ -20,7 +22,7 @@ function ClickSecondaryButton(e, credentials) {
|
|||||||
storiesOf('Components|MainButton', module)
|
storiesOf('Components|MainButton', module)
|
||||||
.addDecorator(withKnobs)
|
.addDecorator(withKnobs)
|
||||||
.addDecorator(withReadme(Readme))
|
.addDecorator(withReadme(Readme))
|
||||||
.add('main button', () => {
|
.add('base', () => {
|
||||||
|
|
||||||
let isDropdown=boolean('isDropdown', true);
|
let isDropdown=boolean('isDropdown', true);
|
||||||
|
|
@ -0,0 +1,17 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { mount } from 'enzyme';
|
||||||
|
import MainButton from '.';
|
||||||
|
import Button from '../button';
|
||||||
|
|
||||||
|
describe('<MainButton />', () => {
|
||||||
|
it('renders without error', () => {
|
||||||
|
const wrapper = mount(
|
||||||
|
<MainButton text='Button' isDisabled={false} isDropdown={true}>
|
||||||
|
<div>Some button</div>
|
||||||
|
<Button label='Some button' />
|
||||||
|
</MainButton>
|
||||||
|
);
|
||||||
|
|
||||||
|
expect(wrapper).toExist();
|
||||||
|
});
|
||||||
|
});
|
Loading…
Reference in New Issue
Block a user