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

This commit is contained in:
Alexey Safronov 2019-09-07 12:26:45 +03:00
parent 68da8fd692
commit cc6acdc562
3 changed files with 19 additions and 2 deletions

View File

@ -0,0 +1,16 @@
import React from 'react';
import { mount } from 'enzyme';
import ContextMenuButton from '.';
describe('<ContextMenuButton />', () => {
it('renders without error', () => {
const wrapper = mount(
<ContextMenuButton
title="Actions"
getData={() => [{key: 'key', label: 'label', onClick: () => alert('label')}]}
/>
);
expect(wrapper).toExist();
});
});

View File

@ -3,8 +3,9 @@ import { storiesOf } from '@storybook/react';
import { withKnobs, text, select, number, color, boolean } from '@storybook/addon-knobs/react';
import withReadme from 'storybook-readme/with-readme';
import Readme from './README.md';
import Section from '../../.storybook/decorators/section';
import { ContextMenuButton, Icons } from 'asc-web-components';
import Section from '../../../.storybook/decorators/section';
import ContextMenuButton from '.';
import { Icons } from '../icons';
const iconNames = Object.keys(Icons);