question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't test React components with Storybook

See original GitHub issue

Are 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)

screen shot 2017-01-18 at 12 28 29

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:closed
  • Created 7 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mkubryczcommented, Jan 24, 2017

Thank you @miherlosev and @churkin !

new version indeed fixed my problem.

1reaction
churkincommented, Jan 19, 2017

@mkubrycz I’m researching it now

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found