Skip to content

Instantly share code, notes, and snippets.

@JorensM
Last active January 23, 2024 11:28
Show Gist options
  • Save JorensM/33cdac4b495d7b5e6b343b7d2cb0dcda to your computer and use it in GitHub Desktop.
Save JorensM/33cdac4b495d7b5e6b343b7d2cb0dcda to your computer and use it in GitHub Desktop.
fireEvent.changeText(title_comp, TITLE)
fireEvent.changeText(description_comp, DESCRIPTION);
fireEvent.press(save_button); // This causes the route to change
await waitFor(() => expect(screen).toHavePathname('/listings/' + LISTING_ID), {timeout: 10 * 1000, interval: 1000});
const title_comp_2 = await waitFor(() => screen.getByText(TITLE)); // Error here
const description_comp_2 = await waitFor(() => screen.getByText(DESCRIPTION));
const author_comp = await waitFor(() => screen.getByText('By ' + AUTHOR_NAME));
expect(title_comp_2).toBeDefined();
expect(description_comp_2).toBeDefined();
expect(author_comp).toBeDefined()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment