wix-style-react
Version:
63 lines (59 loc) • 1.19 kB
JavaScript
import React from 'react';
import { snap, story, visualize } from 'storybook-snapper';
import TimeInputNext from '../TimeInputNext';
import Add from 'wix-ui-icons-common/Add';
const commonProps = {
value: new Date('2021-09-06 12:17:54 GMT+0300'),
};
const tests = [
{
describe: 'time value',
its: [
{
it: 'default',
props: {},
},
{
it: 'disabled',
props: {
disabled: true,
},
},
{
it: 'readOnly',
props: {
readOnly: true,
},
},
{
it: 'timeStyle: long',
props: {
timeStyle: 'long',
},
},
],
},
{
describe: 'suffix/prefix prop',
its: [
{
it: 'suffix and prefix is set',
props: {
suffix: <Add />,
prefix: 'prefix text',
},
},
],
},
];
export const runTests = () => {
visualize(TimeInputNext.displayName, () => {
tests.forEach(({ describe, its }) => {
story(describe, () => {
its.map(({ it, props }) =>
snap(it, () => <TimeInputNext {...commonProps} {...props} />),
);
});
});
});
};