Skip to content
Snippets Groups Projects
Unverified Commit 45f65aad authored by Tim Macdonald's avatar Tim Macdonald Committed by GitHub
Browse files

Make LinkViz search test more robust (#28569)

* Make LinkViz search test more robust

It was flaking on CI due to the race described in the comment

* More sensible implementation courtesy of AlexP
parent 6d988438
No related branches found
No related tags found
No related merge requests found
......@@ -212,6 +212,11 @@ describe("LinkViz", () => {
const searchInput = screen.getByPlaceholderText("https://example.com");
userEvent.click(searchInput);
// There's a race here: as soon the search input is clicked into the text
// "Loading..." appears and is then replaced by "Question Uno". On CI,
// `findByText` was sometimes running while "Loading..." was still
// visible, so the extra expectation ensures good timing
expect(await screen.findByText("Loading...")).toBeInTheDocument();
userEvent.click(await screen.findByText("Question Uno"));
expect(changeSpy).toHaveBeenCalledWith({
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment