Download react-boilerplate/app/containers/HomePage/tests/Section.test.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 853 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-boilerplate/app/containers/HomePage/tests/Section.test.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/react-boilerplate/app/containers/HomePage/tests/Section.test.js
-
curl -L -o Section.test.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/react-boilerplate/app/containers/HomePage/tests/Section.test.js
853 Bytes
| import React from 'react'; | |
| import { render } from 'react-testing-library'; | |
| import Section from '../Section'; | |
| describe('<Section />', () => { | |
| it('should render an <section> tag', () => { | |
| const { container } = render(<Section />); | |
| expect(container.firstChild.tagName).toEqual('SECTION'); | |
| }); | |
| it('should have a class attribute', () => { | |
| const { container } = render(<Section />); | |
| expect(container.firstChild.hasAttribute('class')).toBe(true); | |
| }); | |
| it('should adopt a valid attribute', () => { | |
| const id = 'test'; | |
| const { container } = render(<Section id={id} />); | |
| expect(container.firstChild.id).toEqual(id); | |
| }); | |
| it('should not adopt an invalid attribute', () => { | |
| const { container } = render(<Section attribute="test" />); | |
| expect(container.firstChild.hasAttribute('attribute')).toBe(false); | |
| }); | |
| }); | |