web: components: Moved story for MainButton + added base test

This commit is contained in:
Alexey Safronov 2019-09-08 17:47:55 +03:00
parent 6089591019
commit 9aa96f6216
3 changed files with 21 additions and 2 deletions

View File

@ -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);

View File

@ -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();
});
});