import React from 'react'; import { render } from 'react-testing-library'; import 'jest-dom/extend-expect'; import ListItem from '../index'; describe('', () => { it('should have a class', () => { const { container } = render(); expect(container.querySelector('li').hasAttribute('class')).toBe(true); }); it('should render the content passed to it', () => { const content =
Hello world!
; const { getByTestId } = render(); expect(getByTestId('test').tagName).toEqual('DIV'); expect(getByTestId('test')).toHaveTextContent('Hello world!'); }); });