Last active
September 3, 2021 08:17
-
-
Save DanielMSchmidt/3c236dbb268e0257152f73c7bb99d676 to your computer and use it in GitHub Desktop.
A Jest snapshot test for an accordion
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import renderer from 'react-test-renderer'; | |
import Accordion from '../src/components/Accordion'; | |
describe('Accordion', () => { | |
it('renders the additional content on hover', () => { | |
const component = renderer.create( | |
<Accordion activeIndex={1} headlines={['Foo', 'Bar', 'Baz']} content={['Foo Content', 'Bar content', 'Baz content']} /> | |
); | |
let tree = component.toJSON(); | |
expect(tree).toMatchSnapshot(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment