Download react-hook-form/src/__tests__/utils/isRadioOrCheckbox.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 651 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-hook-form/src/__tests__/utils/isRadioOrCheckbox.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-hook-form/src/__tests__/utils/isRadioOrCheckbox.test.ts
-
curl -L -o isRadioOrCheckbox.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-hook-form/src/__tests__/utils/isRadioOrCheckbox.test.ts
651 Bytes
| import isRadioOrCheckbox from '../../utils/isRadioOrCheckbox'; | |
| describe('isRadioOrCheckbox', () => { | |
| it('should return true when type is either radio or checkbox', () => { | |
| expect(isRadioOrCheckbox({ name: 'test', type: 'radio' })).toBeTruthy(); | |
| expect(isRadioOrCheckbox({ name: 'test', type: 'checkbox' })).toBeTruthy(); | |
| }); | |
| it('shoudl return false when type is neither radio nor checkbox', () => { | |
| expect(isRadioOrCheckbox({ name: 'test', type: 'text' })).toBeFalsy(); | |
| expect(isRadioOrCheckbox({ name: 'test', type: 'email' })).toBeFalsy(); | |
| expect(isRadioOrCheckbox({ name: 'test', type: 'date' })).toBeFalsy(); | |
| }); | |
| }); | |