web: components: Moved story for FilterInput + added base test
This commit is contained in:
parent
607390cba3
commit
544eb23d73
@ -13,14 +13,11 @@ FilterInput description
|
||||
#### Usage
|
||||
|
||||
```js
|
||||
<FilterInput
|
||||
getFilterData={() => [ { key: 'filter-example', group: 'filter-example', label: 'example group', isHeader: true },
|
||||
{ key: '0', group: 'filter-example', label: 'Test' }]
|
||||
}
|
||||
getSortData={() => [ { key: 'name', label: 'Name' },
|
||||
{ key: 'surname', label: 'Surname']
|
||||
onFilter={(result) => {console.log(result)}}
|
||||
/>
|
||||
<FilterInput
|
||||
getFilterData={() => [{ key: 'filter-example', group: 'filter-example', label: 'example group', isHeader: true }, { key: '0', group: 'filter-example', label: 'Test' }]}
|
||||
getSortData={() => [{ key: 'name', label: 'Name' }, { key: 'surname', label: 'Surname' }]}
|
||||
onFilter={(result) => { console.log(result) }}
|
||||
/>
|
||||
```
|
||||
|
||||
|
@ -2,10 +2,11 @@ import React from 'react';
|
||||
import { storiesOf } from '@storybook/react';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { StringValue } from 'react-values';
|
||||
import { withKnobs, boolean, text, select, number } from '@storybook/addon-knobs/react';
|
||||
import { withKnobs, boolean, text, select } from '@storybook/addon-knobs/react';
|
||||
import withReadme from 'storybook-readme/with-readme';
|
||||
import Readme from '../README.md';
|
||||
import { FilterInput, Button } from 'asc-web-components';
|
||||
import Readme from './README.md';
|
||||
import FilterInput from '.';
|
||||
import Button from '../button';
|
||||
import Section from '../../../.storybook/decorators/section';
|
||||
|
||||
const sizeOptions = ['base', 'middle', 'big', 'huge'];
|
@ -0,0 +1,17 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import FilterInput from '.';
|
||||
|
||||
describe('<FilterInput />', () => {
|
||||
it('renders without error', () => {
|
||||
const wrapper = mount(
|
||||
<FilterInput
|
||||
getFilterData={() => [{ key: 'filter-example', group: 'filter-example', label: 'example group', isHeader: true }, { key: '0', group: 'filter-example', label: 'Test' }]}
|
||||
getSortData={() => [{ key: 'name', label: 'Name' }, { key: 'surname', label: 'Surname' }]}
|
||||
onFilter={(result) => { console.log(result) }}
|
||||
/>
|
||||
);
|
||||
|
||||
expect(wrapper).toExist();
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user