Skip to content

Portal.js + Fade.js snapshot testing issues #12237

Closed
@liviuignat

Description

Cannot use Dialog in a storybook because ReactDOM.createPortal fails and after I mock ReactDOM.createPortal, Fade.js throws errors

  • This is a v1.x issue.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Should be able to snapshot test the Dialog

Current Behavior

I have an npm library where I am using @material-ui/core/Dialog. This library has storybooks enabled.

First issue: realized that I have to mock ReactDOM.createPortal:

ReactDom.createPortal = (node) => node;

Second issue: Then struggled for a few hours to understand what is the problem in Fade.js and got stuck at:

Error: TypeError: Cannot set property 'webkitTransition' of undefined

at:

handleExit = node => {
   .....
    node.style.webkitTransition = theme.transitions.create('opacity', transitionProps);
    node.style.transition = theme.transitions.create('opacity', transitionProps);

I just cannot pass over this issue anymore and I don't think I will be the only one having it.

Thanks

Metadata

Assignees

No one assigned

    Labels

    external dependencyBlocked by external dependency, we can’t do anything about itsupport: Stack OverflowPlease ask the community on Stack Overflowtest

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions