import React from 'react' import { render } from '@toptal/picasso-test-utils' import type { FormConfigProps } from '../FormConfig' import { FormCompound as Form } from '../FormCompound' import type { Props as RadioGroupProps } from '../RadioGroup' const renderFormRadio = ( { required, name }: RadioGroupProps, formConfig: FormConfigProps = {} ) => render(
{}} initialValues={{ color: '#ffe4b5' }}>
) describe('FormRadio', () => { it('renders', () => { const { container } = renderFormRadio({ name: 'color', }) expect(container).toMatchSnapshot() }) it('required with asterisk', () => { const { container } = renderFormRadio( { name: 'color', required: true, }, { requiredVariant: 'asterisk', } ) expect(container).toMatchSnapshot() }) })