Skip to content

Commit 92f5bdd

Browse files
committed
test(useCheckAndUpdateGrants): fix You called act(async () => ...) without await error
ref: callstack/react-native-testing-library#379 (comment)
1 parent 80d0a40 commit 92f5bdd

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/hooks/authGrants/useCheckAndUpdateGrants/index.test.tsx

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {GrantEnums} from 'lib/desmos/msgtypes';
2-
import {act, renderHook, waitFor} from '@testing-library/react-native';
2+
import {act, renderHook} from '@testing-library/react-native';
33
import useCheckAndUpdateGrants from 'hooks/authGrants/useCheckAndUpdateGrants/index';
44
import ROUTES from 'navigation/routes';
55
import {checkGrants} from 'hooks/authGrants/useCheckAndUpdateGrants/utils';
@@ -39,12 +39,10 @@ describe('hooks: useCheckAndUpdateGrants', () => {
3939
.then();
4040
});
4141

42-
await waitFor(() => {
43-
expect(mockNavigate).toHaveBeenCalledWith(ROUTES.ACTION_AUTHORIZATION, {
44-
grants: [GrantEnums.MsgCreateReport],
45-
onApprove: expect.anything(),
46-
onCancel: expect.anything(),
47-
});
42+
expect(mockNavigate).toHaveBeenCalledWith(ROUTES.ACTION_AUTHORIZATION, {
43+
grants: [GrantEnums.MsgCreateReport],
44+
onApprove: expect.anything(),
45+
onCancel: expect.anything(),
4846
});
4947
});
5048

0 commit comments

Comments
 (0)