Jest - Testing modals in React gives error
问题 I am using react-test-renderer with Jest to test react components. But if I test a react-mui modal dialog like this: describe('Dashboard', function () { let dashboard; beforeEach(async () => { testRenderer = TestRenderer.create(<MemoryRouter><Route component={Dashboard} /></MemoryRouter>); dashboard = testRenderer.root.findByType(Dashboard); await waitForExpect(() => expect(dashboard.instance.state.hasLoaded).toBeTruthy()); }); it('opens dialog on clicking the new class', async () => { const