Can't test React components with Storybook
See original GitHub issueAre you requesting a feature or reporting a bug?
bug
What is the current behavior?
In our project we use React Storybook and we can’t run tests for it with testcafe. When trying to run tests against storybook’s server we keep getting this error:
Storybook
✖ Component
1) Error on page "http://localhost:6006/":
Uncaught TypeError: se[e.type] is not a function
Browser: Chrome 55.0.2883 / Mac OS X 10.12.2
1/1 failed (1s)
What is the expected behavior?
for tests to run and pass
How would you reproduce the current behavior (if this is a bug)?
Provide the test code and the tested page URL (if applicable)
Tested page URL: local storybook server
Test code
import { Selector } from 'testcafe';
fixture `Storybook`
.page `http://localhost:6006/`;
test('Component', async t => {
await t
.click(Selector('#component'))
// it doesn't matter what are test instructions
});
Specify your
- operating system: Mac OS X 10.12.2
- testcafe version: 0.11.1
- node.js version: 6.9.1
Issue Analytics
- State:
- Created 7 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
Test component interactions with Storybook - JS.ORG
Start by writing a story to set up the component's initial state. Then simulate user behavior such as clicks and form entries using...
Read more >How to use Testing Library to test Storybook - Medium
You are using Storybook for your components and writing tests for them with jest, most likely alongside React testing library.
Read more >Problem with testing components in storybook #229 - GitHub
We are using storybook v 3.4.11 to develop our components and we are using Jest with react-testing-library to test the components, however, ...
Read more >How to simplify component testing with React Storybook
Storybook provides a great way to test our UI components. It may seem like we are doing away with unit testing, but that's...
Read more >Unable to find an element error in react testing library with ...
I am trying to utilize stories from storybook to test my page component as explained here and receives the above error. Here is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thank you @miherlosev and @churkin !
new version indeed fixed my problem.
@mkubrycz I’m researching it now