Content of React modal dialogs is not available to Enzyme tests using mount()

后端 未结 3 1479
面向向阳花
面向向阳花 2021-01-18 05:37

I have a React component with a modal dialog (built using reactstrap, but others have reported similar problems with react-bootstrap and other type

3条回答
  •  Happy的楠姐
    2021-01-18 05:51

    try mocking the createPortal responsible for showing modals ReactDOM.createPortal = jest.fn(modal => modal);

提交回复
热议问题