UNPKG

@wix/design-system

Version:

@wix/design-system

175 lines 3.14 kB
import _extends from "@babel/runtime/helpers/extends"; var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/esm/RadarChart/test/RadarChart.visual.jsx", _this = this; import React from 'react'; import { snap, story, visualize } from 'storybook-snapper'; import RadarChart from '../RadarChart'; var commonProps = {}; var threeDataPoints = [{ value: 10, label: 'Site Sessions' }, { value: 20, label: 'Visitors' }, { value: 30, label: 'Total Orders' }]; var tenDataPoints = [{ value: 70, label: 'Data point 1', color: 'A1' }, { value: 70, label: 'Data point 2', color: 'A1' }, { value: 40, label: 'Data point 3', color: 'A1' }, { value: 70, label: 'Data point 4', color: 'A1' }, { value: 50, label: 'Data point 5', color: 'A1' }, { value: 30, label: 'Data point 6', color: 'A1' }, { value: 50, label: 'Data point 7', color: 'A6' }, { value: 65, label: 'Data point 8', color: 'A6' }, { value: 80, label: 'Data point 9', color: 'A6' }, { value: 55, label: 'Data point 10', color: 'A6' }]; var fourItemScale = [{ value: 25, label: '25%' }, { value: 50, label: '50%' }, { value: 75, label: '75%' }, { value: 100, label: '100%' }]; var fiveItemScale = [{ value: 20, label: '20%' }, { value: 40, label: '40%' }, { value: 60, label: '60%' }, { value: 80, label: '80%' }, { value: 100, label: '100%' }]; var tests = [{ describe: 'data prop', its: [{ it: 'no data points', props: {} }, { it: '3 data points', props: { data: threeDataPoints } }, { it: '10 data points', props: { data: tenDataPoints } }] }, { describe: 'disabled prop', its: [{ it: 'set to true', props: { data: threeDataPoints, disabled: true } }] }, { describe: 'scale prop', its: [{ it: 'default scale', props: { data: threeDataPoints } }, { it: '4 item scale', props: { data: threeDataPoints, scale: fourItemScale } }, { it: '5 item scale', props: { data: threeDataPoints, scale: fiveItemScale } }] }, { describe: 'labelDistance property', its: [{ it: 'default labelDistance', props: { data: threeDataPoints } }, { it: 'labelDistance = 100', props: { data: threeDataPoints, labelDistance: 100 } }, { it: 'labelDistance = 200', props: { data: threeDataPoints, labelDistance: 200 } }] }]; visualize(RadarChart.displayName, function () { tests.forEach(function (_ref) { var describe = _ref.describe, its = _ref.its; story(describe, function () { its.map(function (_ref2) { var it = _ref2.it, props = _ref2.props; return snap(it, function () { return /*#__PURE__*/React.createElement(RadarChart, _extends({}, commonProps, props, { __self: _this, __source: { fileName: _jsxFileName, lineNumber: 148, columnNumber: 24 } })); }); }); }); }); });