@wix/design-system
Version:
@wix/design-system
62 lines • 1.5 kB
JavaScript
import _extends from "@babel/runtime/helpers/extends";
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/esm/EditableSelector/test/EditableSelector.visual.jsx",
_this = this;
import React from 'react';
import { storiesOf } from '@storybook/react';
import EditableSelector from '..';
import { TOGGLE_TYPE } from '../constants';
var types = Object.values(TOGGLE_TYPE);
var requiredProps = {
options: [{
title: 'title1',
isSelected: true
}, {
title: 'title2'
}, {
title: 'title3'
}],
title: 'editable selector title'
};
var tests = [{
describe: 'basic',
its: [{
it: 'basic',
props: {}
}]
}, {
describe: 'newRowLabel',
its: [{
it: 'newRowLabel',
props: {
newRowLabel: 'New Row Label'
}
}]
}, {
describe: 'type',
its: types.map(function (toggleType) {
return {
it: toggleType,
props: {
toggleType: toggleType
}
};
})
}];
tests.forEach(function (_ref) {
var describe = _ref.describe,
its = _ref.its;
its.forEach(function (_ref2) {
var it = _ref2.it,
props = _ref2.props;
storiesOf("EditableSelector".concat(describe ? '/' + describe : ''), module).add(it, function () {
return /*#__PURE__*/React.createElement(EditableSelector, _extends({}, requiredProps, props, {
__self: _this,
__source: {
fileName: _jsxFileName,
lineNumber: 46,
columnNumber: 13
}
}));
});
});
});