UNPKG

@wix/design-system

Version:

@wix/design-system

80 lines (79 loc) 2.13 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); var _react = _interopRequireDefault(require("react")); var _storybookSnapper = require("storybook-snapper"); var _SparklineChart = _interopRequireDefault(require("../SparklineChart")); var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/SparklineChart/test/SparklineChart.visual.jsx", _this = void 0; var commonProps = { data: [{ label: new Date('Thu Sep 4 2020'), value: 3 }, { label: new Date('Thu Sep 5 2020'), value: 17 }, { label: new Date('Thu Sep 6 2020'), value: 18 }, { label: new Date('Thu Sep 7 2020'), value: 12 }, { label: new Date('Thu Sep 8 2020'), value: 8 }, { label: new Date('Thu Sep 9 2020'), value: 7 }, { label: new Date('Thu Sep 10 2020'), value: 9 }] }; var tests = [{ describe: 'sanity', its: [{ it: 'default', props: {} }, { it: 'custom color', props: { color: '#d63429' } }, { it: 'partial highlighted area', props: { highlightedStartingIndex: 2, highlightedEndingIndex: 4 } }, { it: 'custom sizes', props: { width: 400, height: 80 } }] }]; (0, _storybookSnapper.visualize)(_SparklineChart["default"].displayName, function () { tests.forEach(function (_ref) { var describe = _ref.describe, its = _ref.its; (0, _storybookSnapper.story)(describe, function () { its.map(function (_ref2) { var it = _ref2.it, props = _ref2.props; return (0, _storybookSnapper.snap)(it, function () { return /*#__PURE__*/_react["default"].createElement(_SparklineChart["default"], (0, _extends2["default"])({}, commonProps, props, { animationDuration: 0, __self: _this, __source: { fileName: _jsxFileName, lineNumber: 54, columnNumber: 11 } })); }); }); }); }); });