@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
38 lines • 1.42 kB
JavaScript
import React from 'react';
import { render } from '@testing-library/react';
import ListItem from "../ListItem";
describe('ListItem', () => {
test('rendering the defult props', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(ListItem, null));
expect(asFragment()).toMatchSnapshot();
});
test('Should render with renderBeforeChildren', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(ListItem, {
renderBeforeChildren: /*#__PURE__*/React.createElement("span", null, "Before children")
}, "Content"));
expect(asFragment()).toMatchSnapshot();
});
test('ListItem with renderValueRightPlaceholderNode', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(ListItem, {
renderValueRightPlaceholderNode: () => /*#__PURE__*/React.createElement("div", null, "Custom Placeholder")
}));
expect(asFragment()).toMatchSnapshot();
});
test('ListItem with renderValueRightPlaceholderNode & it\'s custom class', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(ListItem, {
renderValueRightPlaceholderNode: () => /*#__PURE__*/React.createElement("div", null, "Custom Placeholder"),
customClass: {
customValueRightPlaceholder: "customValueRightPlaceholderClass"
}
}));
expect(asFragment()).toMatchSnapshot();
});
});