UNPKG

@wix/design-system

Version:

@wix/design-system

98 lines (97 loc) 2.46 kB
"use strict"; var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")); var _react = _interopRequireDefault(require("react")); var _react2 = require("@storybook/react"); var _SelectableAccordion = _interopRequireDefault(require("../SelectableAccordion")); var _constants = require("../constants"); var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/SelectableAccordion/test/SelectableAccordion.visual.jsx", _this = void 0; var types = Object.values(_constants.TYPES); var verticalPaddingOptions = Object.values(_constants.VERTICAL_PADDING); var items = [{ title: 'Title1', content: 'Content1' }, { title: 'Title2', content: 'Content2' }, { title: 'Title3', content: 'Content3' }]; var commonProps = { items: items }; var tests = [{ describe: 'Sanity', its: [{ it: 'default', props: {} }, { it: 'initiallyOpen', props: { items: [{ title: 'Title1', content: 'Content1', initiallyOpen: true }, { title: 'Title2', content: 'Content2' }] } }] }, { describe: 'type', its: types.map(function (type) { return { it: type, props: { type: type } }; }) }, { describe: 'verticalPadding', its: verticalPaddingOptions.map(function (verticalPadding) { return { it: verticalPadding, props: { verticalPadding: verticalPadding } }; }) }, { describe: 'Content', its: [{ it: 'no content', props: { type: _constants.TYPES.CHECKBOX, items: [{ title: 'Title1', open: true }, { title: 'Title2', content: 'Content', open: true }] } }] }]; tests.forEach(function (_ref) { var describe = _ref.describe, its = _ref.its; its.forEach(function (_ref2) { var it = _ref2.it, props = _ref2.props; (0, _react2.storiesOf)("".concat(_SelectableAccordion["default"].displayName).concat(describe ? '/' + describe : ''), module).add(it, function () { return /*#__PURE__*/_react["default"].createElement(_SelectableAccordion["default"], (0, _extends2["default"])({}, commonProps, props, { __self: _this, __source: { fileName: _jsxFileName, lineNumber: 66, columnNumber: 21 } })); }); }); });