Has anyone successfully written a test in Ionic React involving a modal?
I started a new project with v6, which uses Jest and React Testing Library. I’m trying to write tests that involve rendering the content of an inline Ionic Modal component, but the content of the component don’t see to be inspectable by React Testing Library.
test('modal should render with title to add ebook', async () => {
render(<MyModalModalComponent trigger="modal-trigger" />);
screen.getByTestId('modal-title');
screen.debug();
});
It seems like the rendered DOM per the debug is just:
<body>
<div />
</body>
Is anyone aware of any guidance specifically on setting up tests involving the Ionic Modal component?
1 post - 1 participant