From 153c0975cb2460e08749cab8b2ece238221a7caf Mon Sep 17 00:00:00 2001 From: Alexey Safronov Date: Sun, 8 Sep 2019 18:28:32 +0300 Subject: [PATCH] web: components: Moved story for RowContainer + added base test and README.md --- .../src/components/row-container/README.md | 26 +++++++++++++++++++ .../row-container/row-container.stories.js} | 9 +++++-- .../row-container/row-container.test.js | 18 +++++++++++++ 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 web/ASC.Web.Components/src/components/row-container/README.md rename web/{ASC.Web.Storybook/stories/row-container/index.stories.js => ASC.Web.Components/src/components/row-container/row-container.stories.js} (92%) create mode 100644 web/ASC.Web.Components/src/components/row-container/row-container.test.js diff --git a/web/ASC.Web.Components/src/components/row-container/README.md b/web/ASC.Web.Components/src/components/row-container/README.md new file mode 100644 index 0000000000..9e8c833581 --- /dev/null +++ b/web/ASC.Web.Components/src/components/row-container/README.md @@ -0,0 +1,26 @@ +# RowContainer + +## Usage + +```js +import { RowContainer } from 'asc-web-components'; +``` + +#### Description + +Container for rows + +#### Usage + +```js + + {children} + +``` + +#### Properties + +| Props | Type | Required | Values | Default | Description | +| ---------------- | ---------- | :------: | ------ | ------- | --------------------------------------------------------- | +| `manualHeight` | `string` | - | | - | | +| `itemHeight` | `number` | - | | 50 | | \ No newline at end of file diff --git a/web/ASC.Web.Storybook/stories/row-container/index.stories.js b/web/ASC.Web.Components/src/components/row-container/row-container.stories.js similarity index 92% rename from web/ASC.Web.Storybook/stories/row-container/index.stories.js rename to web/ASC.Web.Components/src/components/row-container/row-container.stories.js index c65ac78e5d..54868da1ae 100644 --- a/web/ASC.Web.Storybook/stories/row-container/index.stories.js +++ b/web/ASC.Web.Components/src/components/row-container/row-container.stories.js @@ -1,7 +1,12 @@ import React from 'react'; import { storiesOf } from '@storybook/react'; -import Section from '../../.storybook/decorators/section'; -import { RowContainer, Row, RowContent, Avatar, Link, Icons } from 'asc-web-components'; +import Section from '../../../.storybook/decorators/section'; +import RowContainer from '.'; +import Row from '../row'; +import RowContent from '../row-content'; +import Avatar from '../avatar'; +import Link from '../combobox'; +import { Icons } from '../icons'; const getRndString = (n) => Math.random().toString(36).substring(2, (n + 2)); const getRndNumber = (a, b) => Math.floor(Math.random() * (b - a)) + a; diff --git a/web/ASC.Web.Components/src/components/row-container/row-container.test.js b/web/ASC.Web.Components/src/components/row-container/row-container.test.js new file mode 100644 index 0000000000..046eb04ade --- /dev/null +++ b/web/ASC.Web.Components/src/components/row-container/row-container.test.js @@ -0,0 +1,18 @@ +import React from 'react'; +import { mount } from 'enzyme'; +import Row from '.'; + +describe('', () => { + it('renders without error', () => { + const wrapper = mount( + + Some text + + ); + + expect(wrapper).toExist(); + }); +});