UNPKG

@25sprout/react-starter

Version:

25sprout web starter with React

17 lines (14 loc) 559 B
import React from 'react'; import { render } from '@testing-library/react'; import { composeStories } from '@storybook/testing-react'; import * as stories from './MemberList.stories'; const testCases = Object.values(composeStories(stories)).map(Story => [ // The ! is necessary in Typescript only, as the property is part of a partial type Story.storyName, Story, ]); // Batch snapshot testing test.each(testCases)('Renders %s story', async (_storyName, Story) => { const tree = await render(<Story />); expect(tree.baseElement).toMatchSnapshot(); });