React, Jest and Material-UI: How to test for content rendered in a modal or popover
问题 There are a few material-ui components that do not render their results in the same place as the component is placed by their parent. Among these we have the Dialog , Menu , etc. This makes it apparently impossible to test for their content's presence in a jest.js wrapper with some parent component mounted in it. For example given the following component: class DropdownMenu extends React.Component { onButtonClick = (e) => { this.setState({ open: true, anchorEl: e.currentTarget }); } render()