UNPKG

@zohodesk/dot

Version:

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

107 lines 3.29 kB
import React from 'react'; import { render } from '@testing-library/react'; import ImportantNotes from "../ImportantNotes"; describe('ImportantNotes', () => { test('rendering the defult props', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(ImportantNotes, null)); expect(asFragment()).toMatchSnapshot(); }); test('rendering the text prop', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(ImportantNotes, { text: "sample text for notes" })); expect(asFragment()).toMatchSnapshot(); }); test('rendering the iconName prop', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(ImportantNotes, { iconName: "ZD-GN-info", text: "sample text for notes" })); expect(asFragment()).toMatchSnapshot(); }); test('rendering the iconName prop and text and children are empty', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(ImportantNotes, { iconName: "" })); expect(asFragment()).toMatchSnapshot(); }); test('rendering the iconName prop is null and given text value', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(ImportantNotes, { iconName: "", text: "sample text for notes" })); expect(asFragment()).toMatchSnapshot(); }); test('rendering the iconSize', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(ImportantNotes, { iconName: "ZD-GN-info", iconSize: "15" })); expect(asFragment()).toMatchSnapshot(); }); test('rendering the children', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(ImportantNotes, null, "children")); expect(asFragment()).toMatchSnapshot(); }); test('rendering the text and children prop', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(ImportantNotes, { text: "sample text for notes" }, "Sample text for children")); expect(asFragment()).toMatchSnapshot(); }); test('rendering the text and children prop is empty', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(ImportantNotes, { text: "" })); expect(asFragment()).toMatchSnapshot(); }); test('rendering the iconClass', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(ImportantNotes, { iconName: "ZD-GN-info", iconClass: "customIconClass" })); expect(asFragment()).toMatchSnapshot(); }); test('rendering the isCover prop is true', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(ImportantNotes, null)); expect(asFragment()).toMatchSnapshot(); }); test('rendering the isCover prop is false', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(ImportantNotes, { isCover: false })); expect(asFragment()).toMatchSnapshot(); }); test('rendering the className prop', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(ImportantNotes, { className: "customClass" })); expect(asFragment()).toMatchSnapshot(); }); });