You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.
Our application uses Material UI. I am trying to test the application UI Structure using Story Shots. However, I am running into a few problems. Some I have worked around, however one I have not.
Able to Work Around
In material-ui/src/internal/EnhancedButton.js they are doing a few things during the componentDidMount event. Examples are:
call injectStyle, uses document.createElement and document.body.appendChild to create the style element.
call listenForTabPresses, which calls Events.on and passes in the window object. The Events class calls the following methods addEventListener, removeEventListener, attachEvent, and detachEvent
However, since Story Shots does not have a DOM the window and document objects was not present. I was able to get past these problems by providing a global mock.
Our application uses Material UI. I am trying to test the application UI Structure using Story Shots. However, I am running into a few problems. Some I have worked around, however one I have not.
Able to Work Around
In material-ui/src/internal/EnhancedButton.js they are doing a few things during the componentDidMount event. Examples are:
However, since Story Shots does not have a DOM the window and document objects was not present. I was able to get past these problems by providing a global mock.
Not Able to Work Around
Some components are using refs. For example in the DropDownMenu.js they are using a ref to get the components rootNode.
Since Story Shots does not have a DOM the node is undefined. Therefore this.rootNode is undefined and the component throws an error when rendering.
Does anyone know of any workarounds to the ref problem?
The text was updated successfully, but these errors were encountered: