UNPKG

@wix/design-system

Version:

@wix/design-system

85 lines 2.57 kB
import _extends from "@babel/runtime/helpers/extends"; var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/esm/SidebarTitleItemNext/test/SidebarTitleItemNext.visual.jsx", _this = this; import React from 'react'; import { snap, story, visualize } from 'storybook-snapper'; import SidebarTitleItemNext from '../SidebarTitleItemNext'; import { SidebarNextContext } from '../../SidebarNext/SidebarNextContext'; import Box from '../../Box'; var commonProps = { // use for repeated props across the tests (e.g. {buttonText: 'example'}) }; var tests = [{ describe: 'sanity', // prop name (e.g. size) its: [{ it: 'default dark', // prop variation (e.g. small) props: { children: 'Test text' } }, { it: 'light skin', // prop variation (e.g. small) props: { skin: 'light', children: 'Test text' } }, { it: 'long text', // prop variation (e.g. small) props: { children: 'This is a very long text that should not fit the container' } }] }]; visualize(SidebarTitleItemNext.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(Box, { backgroundColor: "D70", __self: _this, __source: { fileName: _jsxFileName, lineNumber: 44, columnNumber: 11 } }, /*#__PURE__*/React.createElement(Box, { direction: "vertical", marginBottom: 5, marginRight: 5, __self: _this, __source: { fileName: _jsxFileName, lineNumber: 45, columnNumber: 13 } }, /*#__PURE__*/React.createElement(SidebarNextContext.Provider, { value: { skin: props.skin }, __self: _this, __source: { fileName: _jsxFileName, lineNumber: 46, columnNumber: 15 } }, /*#__PURE__*/React.createElement(SidebarTitleItemNext, _extends({}, props, { __self: _this, __source: { fileName: _jsxFileName, lineNumber: 47, columnNumber: 17 } }), props.children)))); }); }); }); }); });