@zohodesk/components
Version:
Dot UI is a customizable React component library built to deliver a clean, accessible, and developer-friendly UI experience. It offers a growing set of reusable components designed to align with modern design systems and streamline application development
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();
});
});