web: components: Moved story for AvatarEditor + added base test
This commit is contained in:
parent
75d55c47e8
commit
f806e09c6b
@ -4,8 +4,9 @@ import { action } from '@storybook/addon-actions';
|
||||
import { withKnobs, boolean, text, select } from '@storybook/addon-knobs/react';
|
||||
import withReadme from 'storybook-readme/with-readme';
|
||||
import Readme from './README.md';
|
||||
import { AvatarEditor, Avatar } from 'asc-web-components';
|
||||
import Section from '../../.storybook/decorators/section';
|
||||
import AvatarEditor from '.';
|
||||
import Avatar from '../avatar';
|
||||
import Section from '../../../.storybook/decorators/section';
|
||||
|
||||
class AvatarEditorStory extends React.Component {
|
||||
constructor(props) {
|
||||
@ -62,7 +63,7 @@ class AvatarEditorStory extends React.Component {
|
||||
storiesOf('Components|AvatarEditor', module)
|
||||
.addDecorator(withKnobs)
|
||||
.addDecorator(withReadme(Readme))
|
||||
.add('avatar editor', () => {
|
||||
.add('base', () => {
|
||||
|
||||
return (
|
||||
<Section>
|
@ -0,0 +1,16 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import AvatarEditor from '.';
|
||||
|
||||
describe('<AvatarEditor />', () => {
|
||||
it('renders without error', () => {
|
||||
const wrapper = mount(
|
||||
<AvatarEditor
|
||||
visible={true}
|
||||
onSave={(data) =>{console.log(data.croppedImage, data.defaultImage)}}
|
||||
/>
|
||||
);
|
||||
|
||||
expect(wrapper).toExist();
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue
Block a user