/
githubmirror
/
react-hook-form
Обзор
Документация
Войти
/
githubmirror
/
react-hook-form
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
src/__tests__/utils/isHTMLElement.test.ts
17 строк
596 B
zeno
🤝 fix: compare html elements against correct global (#8355)
01 июн 2022, 02:24
Не верифицирован
01 июн 2022, 02:24
c4e0268
Код
Авторство
О чём код?
import isHTMLElement from '../../utils/isHTMLElement'; describe('isHTMLElement', () => { it('should return true when value is HTMLElement', () => { expect(isHTMLElement(document.createElement('input'))).toBeTruthy(); }); it('should return true when HTMLElement is inside an iframe', () => { const iframe = document.createElement('iframe'); document.body.append(iframe); const iframeDocument = iframe.contentDocument!; const input = iframeDocument.createElement('input'); iframeDocument.body.append(input); expect(isHTMLElement(input)).toBeTruthy(); }); });