Skip to content
Snippets Groups Projects
Unverified Commit 167be1df authored by github-automation-metabase's avatar github-automation-metabase Committed by GitHub
Browse files

test(sdk): assert abort calls on static question unmount (#49197) (#49231)

parent 920f8770
No related branches found
No related tags found
No related merge requests found
......@@ -180,14 +180,14 @@ describe("StaticQuestion", () => {
const abortSpy = jest.spyOn(AbortController.prototype, "abort");
const { unmount } = setup();
await act(async () => unmount());
expect(abortSpy).toHaveBeenCalled();
abortSpy.mockRestore();
// sanity check that the two requests were made initially
// two requests should've been made initially
expect(fetchMock.calls(`path:/api/card/1`).length).toBe(1);
expect(fetchMock.calls(`path:/api/card/1/query`).length).toBe(1);
// consequently, two abort calls should've been made for the two requests
expect(abortSpy).toHaveBeenCalledTimes(2);
abortSpy.mockRestore();
});
});
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