added max timeout of 10s to all jest tests for cases when it needs to wait

timeout value
This commit is contained in:
Rares Mardare 2022-12-07 13:28:42 +02:00
parent d85f16c9f1
commit ebc62ab69f
2 changed files with 14 additions and 2 deletions

View file

@ -20,4 +20,6 @@ module.exports = {
},
setupFilesAfterEnv: ['<rootDir>/jest.setup.ts'],
testTimeout: 10000,
};

View file

@ -22,7 +22,7 @@ type Props = {
};
const INTERVAL_MIN_THROTTLING = 500;
const INTERVAL_QUEUE_QR = 10000;
const INTERVAL_QUEUE_QR = 50000;
const INTERVAL_POLLING = 5000;
const BACKEND = 'MOBILE_APP';
@ -166,6 +166,10 @@ const MobileAppVerification = observer(({ userPk }: Props) => {
}
async function queueRefreshQR(): Promise<void> {
if (!isMounted.current) {
return;
}
clearTimeout(refreshTimeoutId);
setRefreshTimeoutId(undefined);
@ -175,7 +179,9 @@ const MobileAppVerification = observer(({ userPk }: Props) => {
let isRequestDone = false;
const throttle = () => {
if (!isMounted.current || !isRequestDone) {return;}
if (!isMounted.current || !isRequestDone) {
return;
}
setIsQRBlurry(false);
setTimeout(queueRefreshQR, INTERVAL_QUEUE_QR);
};
@ -193,6 +199,10 @@ const MobileAppVerification = observer(({ userPk }: Props) => {
}
async function pollUserProfile(): Promise<void> {
if (!isMounted.current) {
return;
}
clearTimeout(userTimeoutId);
setUserTimeoutId(undefined);