UNPKG

@zohodesk/dot

Version:

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

46 lines 1.07 kB
import React from 'react'; import { render } from '@testing-library/react'; import RadioField from "../RadioField"; const options = [{ text: 'Chennai', value: '1' }, { text: 'Mumbai', value: '2', tooltip: 'Disabled Option', disabled: true }, { text: 'Delhi', value: '3', infoTooltip: 'Capital of India' }, { text: 'Kolkata', value: '4' }]; describe('RadioField', () => { test('rendering the defult props', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(RadioField, { options: [] })); expect(asFragment()).toMatchSnapshot(); }); test('rendering with options', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(RadioField, { options: options })); expect(asFragment()).toMatchSnapshot(); }); test('rendering options with isBoxStyle', () => { const { asFragment } = render( /*#__PURE__*/React.createElement(RadioField, { options: options, isBoxStyle: true })); expect(asFragment()).toMatchSnapshot(); }); });