@wix/design-system
Version:
@wix/design-system
97 lines • 2.2 kB
JavaScript
import _extends from "@babel/runtime/helpers/extends";
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/esm/Swatches/test/Swatches.visual.jsx",
_this = this;
import React from 'react';
import { storiesOf } from '@storybook/react';
import Swatches from '../Swatches';
import Box from '../../Box';
var commonProps = {
colors: ['#000', '#fff', 'red', 'cyan', 'rgb(200, 100, 0)', 'turquoise', 'beige']
};
var tests = [{
describe: 'sanity',
// prop name (e.g. size)
its: [{
it: 'works',
// prop variation (e.g. small)
props: {}
}]
}, {
describe: 'columns',
// prop name (e.g. size)
its: [{
it: '6 columns',
// prop variation (e.g. small)
props: {
columns: 6
}
}, {
it: '4 columns',
// prop variation (e.g. small)
props: {
columns: 4
}
}, {
it: '2 columns',
// prop variation (e.g. small)
props: {
columns: 2
}
}]
}, {
describe: 'No Color',
// prop name (e.g. size)
its: [{
it: '6 columns',
// prop variation (e.g. small)
props: {
showClear: true
}
}]
}, {
describe: 'No Color',
// prop name (e.g. size)
its: [{
it: 'no color swatch',
// prop variation (e.g. small)
props: {
showClear: true
}
}]
}, {
describe: 'Add button',
// prop name (e.g. size)
its: [{
it: 'button',
// prop variation (e.g. small)
props: {
showAddButton: true
}
}]
}];
tests.forEach(function (_ref) {
var describe = _ref.describe,
its = _ref.its;
its.forEach(function (_ref2) {
var it = _ref2.it,
props = _ref2.props;
storiesOf("Swatches".concat(describe ? '/' + describe : ''), module).add(it, function () {
return /*#__PURE__*/React.createElement(Box, {
width: "204px",
__self: _this,
__source: {
fileName: _jsxFileName,
lineNumber: 91,
columnNumber: 9
}
}, /*#__PURE__*/React.createElement(Swatches, _extends({}, commonProps, props, {
__self: _this,
__source: {
fileName: _jsxFileName,
lineNumber: 92,
columnNumber: 11
}
})));
});
});
});