import { create } from 'react-test-renderer'; import TableOfContents from './TableOfContents'; describe('TableOfContents', () => { it('renders', () => { const tree = create( {}} /> , ).toJSON(); expect(tree).toMatchSnapshot(); }); it('renders an accessibility label', () => { const tree = create( , ).toJSON(); expect(tree).toMatchSnapshot(); }); it('renders without title', () => { const tree = create( , ).toJSON(); expect(tree).toMatchSnapshot(); }); it('renders nested items', () => { const tree = create( , ).toJSON(); expect(tree).toMatchSnapshot(); }); });