@zohodesk/components
Version:
In this Package, we Provide Some Basic Components to Build Web App
37 lines • 1.75 kB
JavaScript
import React from 'react';
import Buttongroup from "../Buttongroup.js";
import { render } from "@testing-library/react";
describe('Buttongrop - ', () => {
test('rendering the default props', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(Buttongroup, null));
expect(asFragment()).toMatchSnapshot();
});
const buttonPosition = ['left', 'right', 'center'];
test.each(buttonPosition)('rendering the "buttonPosition" to - %s', buttonPosition => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(Buttongroup, {
buttonPosition: buttonPosition
}, /*#__PURE__*/React.createElement("span", null, "Element 1"), /*#__PURE__*/React.createElement("span", null, "Element 2"), /*#__PURE__*/React.createElement("span", null, "Element 3")));
expect(asFragment()).toMatchSnapshot();
});
test('Checking the "customclass"', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(Buttongroup, {
customClass: "customClassButtonGroup"
}, /*#__PURE__*/React.createElement("span", null, "Element 1"), /*#__PURE__*/React.createElement("span", null, "Element 2"), /*#__PURE__*/React.createElement("span", null, "Element 3")));
expect(asFragment()).toMatchSnapshot();
});
const type = ['footer', 'header', 'tab'];
test.each(type)('rendering the "type" - %s', type => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(Buttongroup, {
type: type
}, /*#__PURE__*/React.createElement("span", null, "Element 1"), /*#__PURE__*/React.createElement("span", null, "Element 2"), /*#__PURE__*/React.createElement("span", null, "Element 3")));
expect(asFragment()).toMatchSnapshot();
});
});