@zohodesk/components
Version:
In this Package, we Provide Some Basic Components to Build Web App
46 lines • 1.41 kB
JavaScript
import React from 'react';
import { render } from '@testing-library/react';
import Stencils from "../Stencils.js";
describe('Stencils', () => {
test('rendering the defult props', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(Stencils, null));
expect(asFragment()).toMatchSnapshot();
});
const palette = ['primary', 'secondary', 'dark'];
test.each(palette)('rendering the palette of- %s', palette => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(Stencils, {
palette: palette
}));
expect(asFragment()).toMatchSnapshot();
});
const shape = ['rect', 'circle'];
test.each(shape)('rendering the shape of- %s', shape => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(Stencils, {
shape: shape
}));
expect(asFragment()).toMatchSnapshot();
});
const size = ['small', 'medium', 'large', 'default'];
test.each(size)('rendering the size of- %s', size => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(Stencils, {
size: size
}));
expect(asFragment()).toMatchSnapshot();
});
test('rendering the customClass', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(Stencils, {
customClass: "StencilsCustomClass"
}));
expect(asFragment()).toMatchSnapshot();
});
});