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

This commit is contained in:
Alexey Safronov 2019-09-06 12:22:21 +03:00
parent 75d55c47e8
commit f806e09c6b
3 changed files with 20 additions and 3 deletions

View File

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

View File

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