From 9fdc1aa7c34bb37ca8ee6843dcd7cc755e990c99 Mon Sep 17 00:00:00 2001 From: "Monil Bhavsar (via MelvinBot)" Date: Mon, 16 Mar 2026 06:27:46 +0000 Subject: [PATCH] Add getCurrentPosition mock to fix flaky IOURequestStepConfirmationPageTest The test intermittently fails because a leaked async operation triggers getCurrentPosition, which calls expo-location requestForegroundPermissionsAsync. Without a mock, it resolves to undefined, causing a TypeError on .status access. Co-authored-by: Monil Bhavsar --- tests/ui/components/IOURequestStepConfirmationPageTest.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/ui/components/IOURequestStepConfirmationPageTest.tsx b/tests/ui/components/IOURequestStepConfirmationPageTest.tsx index e6c3c1473143..6dc5070e6e0c 100644 --- a/tests/ui/components/IOURequestStepConfirmationPageTest.tsx +++ b/tests/ui/components/IOURequestStepConfirmationPageTest.tsx @@ -77,6 +77,7 @@ jest.mock('@components/ProductTrainingContext', () => ({ useProductTrainingContext: () => [false], })); jest.mock('@src/hooks/useResponsiveLayout'); +jest.mock('@libs/getCurrentPosition'); jest.mock('@libs/Navigation/navigationRef', () => ({ getCurrentRoute: jest.fn(() => ({