import React from 'react'; import { render } from 'react-testing-library'; import Section from '../Section'; describe('
', () => { it('should render an
tag', () => { const { container } = render(
); expect(container.firstChild.tagName).toEqual('SECTION'); }); it('should have a class attribute', () => { const { container } = render(
); expect(container.firstChild.hasAttribute('class')).toBe(true); }); it('should adopt a valid attribute', () => { const id = 'test'; const { container } = render(
); expect(container.firstChild.id).toEqual(id); }); it('should not adopt an invalid attribute', () => { const { container } = render(
); expect(container.firstChild.hasAttribute('attribute')).toBe(false); }); });