Skip to content

Commit

Permalink
add await for act
Browse files Browse the repository at this point in the history
Signed-off-by: Viktor Tsvetkov <142901247+vtsvetkov-splunk@users.noreply.github.com>
  • Loading branch information
vtsvetkov-splunk committed Jan 28, 2025
1 parent a76f613 commit 604b4f4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ui/src/components/EntityModal/EntityModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -491,12 +491,12 @@ describe('Oauth - separated endpoint authorization', () => {

// triggering manually external oauth window behaviour after success authorization
const code = '200';
window.getMessage({ code, state: stateCodeFromUrl, error: undefined });

await waitFor(async () => {
expect(requestHandler).toHaveBeenCalledTimes(1);
await act(async () => {
window.getMessage({ code, state: stateCodeFromUrl, error: undefined });
});

expect(requestHandler).toHaveBeenCalledTimes(1);

const receivedRequest: Request = requestHandler.mock.calls[0][0];
const receivedBody = await receivedRequest.text();

Expand Down Expand Up @@ -534,7 +534,7 @@ describe('Oauth - separated endpoint authorization', () => {
// triggering manually external oauth window behaviour after success authorization
const code = '200';
const passedState = `tests${stateCodeFromUrl}`;
act(() => {
await act(async () => {
window.getMessage({ code, state: passedState, error: undefined });
});

Expand Down

0 comments on commit 604b4f4

Please sign in to comment.