react-code-dataset / react-hook-form /src /__tests__ /utils /isRadioOrCheckbox.test.ts
Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
Raw History Blame Contribute Delete
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();
});
});