storybook/docs/snippets/react/button-test.js.mdx
Tom Coleman f43be2a334
Update button-test.js.mdx
See https://github.com/storybookjs/storybook/issues/12079

We never shipped `renderStory` and this change got lost in the mix.
2020-08-18 16:47:06 +10:00

15 lines
381 B
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

```js
// Button.test.js
import React from 'react';
import { render, screen } from '@testing-library/react';
import '@testing-library/jest-dom/extend-expect';
import { Primary } from './Button.stories';
it('renders the button in the primary state, () => {
render(<Primary {...Primary.args} />);
expect(screen.getByRole('button')).toHaveTextContent(Primary);
});
```