Skip to content

Commit

Permalink
[Lens] remove warnings when running tests (#95637) (#95648)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbondyra committed Mar 29, 2021
1 parent 9393be0 commit 4085278
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ describe('IndexPattern Data Panel', () => {
});

// wait for indx pattern to be loaded
await new Promise((r) => setTimeout(r, 0));
await act(async () => await new Promise((r) => setTimeout(r, 0)));

expect(props.indexPatternFieldEditor.openEditor).toHaveBeenCalledWith(
expect.objectContaining({
Expand Down Expand Up @@ -860,10 +860,11 @@ describe('IndexPattern Data Panel', () => {
.prop('children') as ReactElement).props.items[0].props.onClick();
});
// wait for indx pattern to be loaded
await new Promise((r) => setTimeout(r, 0));
await act(async () => await new Promise((r) => setTimeout(r, 0)));

await (props.indexPatternFieldEditor.openEditor as jest.Mock).mock.calls[0][0].onSave();
// wait for indx pattern to be loaded
await new Promise((r) => setTimeout(r, 0));
await act(async () => await new Promise((r) => setTimeout(r, 0)));
expect(props.onUpdateIndexPattern).toHaveBeenCalledWith(
expect.objectContaining({
fields: [
Expand Down

0 comments on commit 4085278

Please sign in to comment.