@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
65 lines • 2.37 kB
JavaScript
import React from 'react';
import { render } from '@testing-library/react';
import ListItemWithRadio from "../ListItemWithRadio";
describe('ListItemWithRadio', () => {
test('rendering the defult props', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(ListItemWithRadio, null));
expect(asFragment()).toMatchSnapshot();
});
test('ListItemWithRadio with secondaryValue', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(ListItemWithRadio, {
secondaryValue: "secondaryValue"
}));
expect(asFragment()).toMatchSnapshot();
});
test('ListItemWithRadio with secondaryValue text and LHS align start', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(ListItemWithRadio, {
secondaryValue: "secondaryValue",
lhsAlignContent: "start"
}));
expect(asFragment()).toMatchSnapshot();
});
test('ListItemWithRadio with secondaryValue text and LHS align center', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(ListItemWithRadio, {
secondaryValue: "secondaryValue",
lhsAlignContent: "center"
}));
expect(asFragment()).toMatchSnapshot();
});
test('ListItemWithRadio with secondaryValue text and LHS align end', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(ListItemWithRadio, {
secondaryValue: "secondaryValue",
lhsAlignContent: "end"
}));
expect(asFragment()).toMatchSnapshot();
});
test('ListItemWithRadio with renderValueRightPlaceholderNode', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(ListItemWithRadio, {
renderValueRightPlaceholderNode: () => /*#__PURE__*/React.createElement("div", null, "Custom Placeholder")
}));
expect(asFragment()).toMatchSnapshot();
});
test('ListItemWithRadio with renderValueRightPlaceholderNode & it\'s custom class', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(ListItemWithRadio, {
renderValueRightPlaceholderNode: () => /*#__PURE__*/React.createElement("div", null, "Custom Placeholder"),
customClass: {
customValueRightPlaceholder: "customValueRightPlaceholderClass"
}
}));
expect(asFragment()).toMatchSnapshot();
});
});