Skip to content

Commit e1084ef

Browse files
Fix warnings about act in jest tests
Co-authored-by: Teresa Siegmantel <[email protected]>
1 parent 8304d9f commit e1084ef

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

tests/unit/ui/CheckMkAsyncSelect.test.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { SelectableValue } from '@grafana/data';
2-
import { render } from '@testing-library/react';
2+
import { act, render } from '@testing-library/react';
33
import * as React from 'react';
44

55
import { CheckMkAsyncSelect } from '../../../src/ui/components';
@@ -13,10 +13,11 @@ describe('CheckMkAsyncSelect', () => {
1313
});
1414

1515
it("uses the specific options if the default ones don't include the value", async () => {
16-
const screen = await render(
17-
<CheckMkAsyncSelect autocompleter={autocompleter} inputId={'foo'} onChange={() => undefined} value="sentinel" />
18-
);
19-
16+
await act(async () => {
17+
await render(
18+
<CheckMkAsyncSelect autocompleter={autocompleter} inputId={'foo'} onChange={() => undefined} value="sentinel" />
19+
);
20+
});
2021
expect(autocompleter).toHaveBeenCalledWith('');
2122
expect(autocompleter).toHaveBeenCalledWith('sentinel');
2223
});

0 commit comments

Comments
 (0)