Skip to content

Commit

Permalink
Return Promise in workflow history test (#808)
Browse files Browse the repository at this point in the history
Return Promise in workflow history test to fix flakiness with rendering
Use waitFor instead of waitForElementToBeRemoved
  • Loading branch information
adhityamamallan authored Feb 5, 2025
1 parent 0bc0179 commit a27f131
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
render,
screen,
userEvent,
waitFor,
waitForElementToBeRemoved,
} from '@/test-utils/rtl';

Expand Down Expand Up @@ -168,7 +169,9 @@ describe('WorkflowHistory', () => {
});
});

await waitForElementToBeRemoved(loadingIndicator);
await waitFor(() => {
expect(loadingIndicator).not.toBeInTheDocument();
});
});
});

Expand Down Expand Up @@ -223,7 +226,7 @@ async function setup({
httpResolver: async () => {
requestIndex = requestIndex + 1;
if (requestIndex > 0 && resolveLoadMoreManually) {
await new Promise((resolve, reject) => {
return await new Promise((resolve, reject) => {
requestResolver = (result: GetWorkflowHistoryResponse) =>
resolve(HttpResponse.json(result, { status: 200 }));
requestRejector = () =>
Expand Down

0 comments on commit a27f131

Please sign in to comment.