@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
61 lines • 2.08 kB
JavaScript
import React from 'react';
import { render } from '@testing-library/react';
import { CardContent } from "../Card";
describe('CardContent', () => {
test('rendering the defult props', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(CardContent, null));
expect(asFragment()).toMatchSnapshot();
});
test('rendering children', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(CardContent, null, "Test"));
expect(asFragment()).toMatchSnapshot();
});
test('rendering isScrollAttribute is true', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(CardContent, {
isScrollAttribute: true
}, "Test"));
expect(asFragment()).toMatchSnapshot();
});
const scroll = ['vertical', 'horizontal', 'both', 'none'];
test.each(scroll)('Should render with name - %s', scroll => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(CardContent, {
isScrollAttribute: true,
scroll: scroll
}, /*#__PURE__*/React.createElement("div", null, "Test Animation")));
expect(asFragment()).toMatchSnapshot();
});
test('rendering shrink is true', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(CardContent, {
shrink: true
}, "Test"));
expect(asFragment()).toMatchSnapshot();
});
test('rendering customClass is true', () => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(CardContent, {
customClass: "cardCustomClass"
}, "Test"));
expect(asFragment()).toMatchSnapshot();
});
const preventParentScroll = ['vertical', 'horizontal', 'both'];
test.each(preventParentScroll)('Should render with name - %s', preventParentScroll => {
const {
asFragment
} = render( /*#__PURE__*/React.createElement(CardContent, {
isScrollAttribute: true,
preventParentScroll: preventParentScroll
}, /*#__PURE__*/React.createElement("div", null, "Test")));
expect(asFragment()).toMatchSnapshot();
});
});