UNPKG

@zohodesk/dot

Version:

In this Library, we Provide Some Basic Components to Build Your Application

68 lines 1.97 kB
import React from 'react'; import { render } from '@testing-library/react'; import PlusIcon from "../PlusIcon"; describe('PlusIcon', () => { const size = ['small', 'xsmall', 'xxsmall', 'medium', 'xmedium', 'xlarge']; test('renders with default props', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(PlusIcon, null)); expect(asFragment()).toMatchSnapshot(); }); test('renders with dataId prop', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(PlusIcon, { dataId: "test-id" })); expect(asFragment()).toMatchSnapshot(); }); test('renders with iconName prop', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(PlusIcon, { iconName: "ZD-plus" })); expect(asFragment()).toMatchSnapshot(); }); test('renders with iconClass prop', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(PlusIcon, { iconClass: "custom-icon-class" })); expect(asFragment()).toMatchSnapshot(); }); test('renders with iconSize prop', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(PlusIcon, { iconSize: "16" })); expect(asFragment()).toMatchSnapshot(); }); test.each(size)('renders with size is - %s', size => { const { asFragment } = render( /*#__PURE__*/React.createElement(PlusIcon, { size: size })); expect(asFragment()).toMatchSnapshot(); }); test('renders with title prop', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(PlusIcon, { title: "Plus Icon" })); expect(asFragment()).toMatchSnapshot(); }); test('renders with customClass prop', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(PlusIcon, { customClass: "custom-plus-icon" })); expect(asFragment()).toMatchSnapshot(); }); });