UNPKG

@wix/design-system

Version:

@wix/design-system

267 lines 5.13 kB
import _extends from "@babel/runtime/helpers/extends"; var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/esm/CircularProgressBar/test/CircularProgressBar.visual.jsx", _this = this; import React from 'react'; import { storiesOf } from '@storybook/react'; import CircularProgressBar from '../CircularProgressBar'; import { Skin, Size } from '../constants'; var tests = [{ describe: 'basic', its: [{ it: 'default render', props: { value: 20 } }] }, { describe: 'progress indication', its: [{ it: 'shown', props: { value: 20, showProgressIndication: true } }, { it: 'hidden', props: { value: 20 } }, { it: 'success icon is shown when progress is 100%', props: { value: 100, showProgressIndication: true } }, { it: 'error icon is shown when there is an error', props: { value: 20, showProgressIndication: true, error: true, errorMessage: 'Some error' } }] }, { describe: 'custom label', its: [{ it: 'with label', props: { label: '1/5', value: 20 } }] }, { describe: 'theme', its: [{ it: 'light regular', props: { value: 20, light: true } }, { it: 'light with an error', props: { value: 20, light: true, error: true } }] }, { describe: 'error', its: [{ it: 'exists', props: { value: 20, error: true } }, { it: 'does not exist', props: { value: 20, error: false } }, { it: 'display an error icon', props: { value: 20, showProgressIndication: true, error: true, errorMessage: 'Some error' } }] }, { describe: 'skin', its: [{ it: 'standard', props: { value: 20, skin: Skin.standard } }, { it: 'premium', props: { value: 20, skin: Skin.standard } }, { it: 'success', props: { value: 20, skin: Skin.success } }, { it: 'standard light', props: { value: 20, skin: Skin.standard, light: true } }, { it: 'premium light', props: { value: 20, skin: Skin.standard, light: true } }, { it: 'success light', props: { value: 20, skin: Skin.success, light: true } }] }, { describe: 'size', its: [{ it: 'tiny', props: { size: Size.tiny, showProgressIndication: true, value: 20 } }, { it: 'small', props: { size: Size.small, showProgressIndication: true, value: 20 } }, { it: 'medium', props: { size: Size.medium, showProgressIndication: true, value: 20 } }, { it: 'large', props: { size: Size.large, showProgressIndication: true, value: 20 } }] }, { describe: 'label placement', its: [{ it: 'center with label', props: { label: '1/5', value: 20, labelPlacement: 'center', showProgressIndication: true } }, { it: 'center without label', props: { value: 20, labelPlacement: 'center', showProgressIndication: true } }, { it: 'bottom with label', props: { label: '1/5', value: 20, labelPlacement: 'bottom', showProgressIndication: true } }, { it: 'bottom without label', props: { value: 20, labelPlacement: 'bottom', showProgressIndication: true } }] }, { describe: 'indicators', its: [{ it: 'default render', props: { size: Size.tiny, value: 20 } }, { it: 'progress indicator', props: { size: Size.tiny, value: 20, showProgressIndication: true } }, { it: 'success icon is shown when progress is 100%', props: { size: Size.tiny, value: 100, showProgressIndication: true } }, { it: 'error icon is shown when there is an error', props: { size: Size.tiny, value: 20, showProgressIndication: true, error: true, errorMessage: 'Some error' } }, { it: 'center label placement not rendered', props: { size: Size.tiny, label: '1/5', value: 20, labelPlacement: 'center', showProgressIndication: true } }] }]; tests.forEach(function (_ref) { var describe = _ref.describe, its = _ref.its; its.forEach(function (_ref2) { var it = _ref2.it, props = _ref2.props; storiesOf("CircularProgressBar/".concat(describe), module).add(it, function () { return /*#__PURE__*/React.createElement("div", { style: { width: '40%' }, __self: _this, __source: { fileName: _jsxFileName, lineNumber: 218, columnNumber: 7 } }, /*#__PURE__*/React.createElement(CircularProgressBar, _extends({}, props, { __self: _this, __source: { fileName: _jsxFileName, lineNumber: 219, columnNumber: 9 } }))); }); }); });