/
githubmirror
/
react-hook-form
Обзор
Документация
Войти
/
githubmirror
/
react-hook-form
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/__tests__/utils/isRadioOrCheckbox.test.ts
14 строк
651 B
Bill
7️⃣ V7 (#3741)
01 апр 2021, 00:14
Не верифицирован
01 апр 2021, 00:14
9555d16
Код
Авторство
О чём код?
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(); }); });