Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getComputedStyleX is not a function #39

Open
nirradi opened this issue Sep 26, 2018 · 0 comments
Open

getComputedStyleX is not a function #39

nirradi opened this issue Sep 26, 2018 · 0 comments

Comments

@nirradi
Copy link

nirradi commented Sep 26, 2018

I'm unit testing a component of mine that uses antd dropdown.
I get this error when trying to use enzyme to mount the component and then simulate a click on that drop down.

The above error occurred in the <Align> component:
    in Align (created by Popup)
    in AnimateChild (created by Animate)
    in Animate (created by Popup)
    in div (created by Popup)
    in Popup (created by Trigger)
    in Portal (created by Trigger)
    in Trigger (created by Dropdown)
    in Dropdown (created by Dropdown)
 TypeError: getComputedStyleX is not a function
          at getWH (node_modules/dom-align/lib/utils.js:434:23)
          at HTMLAnchorElement.<anonymous> (node_modules/dom-align/lib/utils.js:486:19)
          at swap (node_modules/dom-align/lib/utils.js:359:12)
          at getWHIgnoreDisplay (node_modules/dom-align/lib/utils.js:485:5)
          at Object.domUtils.(anonymous function) [as outerWidth] (node_modules/dom- 
   align/lib/utils.js:495:18)
          at getRegion (node_modules/dom-align/lib/getRegion.js:19:28)
          at alignElement (node_modules/dom-align/lib/align/alignElement.js:34:50)
          at Align._this.forceAlign (node_modules/rc-align/lib/Align.js:76:47)
          at Align.componentDidMount (node_modules/rc-align/lib/Align.js:91:10)
         at commitLifeCycles (node_modules/react-dom/cjs/react-dom.development.js:14362:22)

I definitely do have a window defined.


        console.log(".....", window.getComputedStyle);
        let wrapper = mount(<UserMenu />);
        wrapper.find(Dropdown).simulate('click')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant