Download react-hook-form/src/__tests__/utils/isHTMLElement.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 596 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-hook-form/src/__tests__/utils/isHTMLElement.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-hook-form/src/__tests__/utils/isHTMLElement.test.ts
-
curl -L -o isHTMLElement.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-hook-form/src/__tests__/utils/isHTMLElement.test.ts
596 Bytes
| 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(); | |
| }); | |
| }); | |