@@ -5,13 +5,26 @@ import React from 'react';
55jest . mock ( 'react-native' , ( ) => ( {
66 Platform : {
77 OS : 'ios' ,
8+ select : ( obj : any ) => obj . ios ?? obj . default ,
9+ } ,
10+ PixelRatio : {
11+ getFontScale : ( ) => 1 ,
12+ get : ( ) => 2 ,
13+ roundToNearestPixel : ( size : number ) => size ,
14+ } ,
15+ Dimensions : {
16+ get : ( ) => ( { width : 375 , height : 812 , scale : 2 , fontScale : 1 } ) ,
17+ addEventListener : jest . fn ( ) ,
18+ removeEventListener : jest . fn ( ) ,
819 } ,
920 ScrollView : ( { children, ...props } : any ) => < div { ...props } > { children } </ div > ,
1021 StyleSheet : {
1122 create : ( styles : any ) => styles ,
23+ flatten : ( styles : any ) => styles ,
1224 } ,
1325 useWindowDimensions : ( ) => ( { width : 375 , height : 812 } ) ,
1426 View : ( { children, ...props } : any ) => < div { ...props } > { children } </ div > ,
27+ Text : ( { children, ...props } : any ) => < span { ...props } > { children } </ span > ,
1528} ) ) ;
1629
1730// Mock expo-router
@@ -153,6 +166,7 @@ jest.mock('react-i18next', () => ({
153166} ) ) ;
154167
155168jest . mock ( 'nativewind' , ( ) => ( {
169+ cssInterop : jest . fn ( ( Component : any ) => Component ) ,
156170 useColorScheme : ( ) => ( { colorScheme : 'light' } ) ,
157171} ) ) ;
158172
@@ -304,6 +318,36 @@ jest.mock('react-native-svg', () => ({
304318 Mixin : { } ,
305319} ) ) ;
306320
321+ // Mock @legendapp /motion
322+ jest . mock ( '@legendapp/motion' , ( ) => ( {
323+ Motion : {
324+ View : jest . fn ( ) . mockImplementation ( ( { children } : any ) => children ) ,
325+ Text : jest . fn ( ) . mockImplementation ( ( { children } : any ) => children ) ,
326+ } ,
327+ AnimatePresence : jest . fn ( ) . mockImplementation ( ( { children } : any ) => children ) ,
328+ createMotionAnimatedComponent : jest . fn ( ( Component : any ) => Component ) ,
329+ } ) ) ;
330+
331+ // Mock bottom-sheet to avoid deep gluestack/actionsheet import chain
332+ jest . mock ( '@/components/ui/bottom-sheet' , ( ) => ( {
333+ BottomSheet : ( { children } : any ) => < div > { children } </ div > ,
334+ BottomSheetContent : ( { children } : any ) => < div > { children } </ div > ,
335+ BottomSheetDragIndicator : ( ) => null ,
336+ BottomSheetDragIndicatorWrapper : ( { children } : any ) => < div > { children } </ div > ,
337+ BottomSheetBackdrop : ( ) => null ,
338+ } ) ) ;
339+
340+ // Mock video feeds tab to avoid actionsheet import chain
341+ jest . mock ( '@/components/callVideoFeeds/video-feeds-tab' , ( ) => ( {
342+ __esModule : true ,
343+ default : ( ) => < div data-testid = "video-feeds-tab" > Video Feeds</ div > ,
344+ } ) ) ;
345+
346+ // Mock check-in tab
347+ jest . mock ( '@/components/checkIn/check-in-tab' , ( ) => ( {
348+ CheckInTab : ( ) => < div data-testid = "check-in-tab" > Check In</ div > ,
349+ } ) ) ;
350+
307351import CallDetail from '../../../app/call/[id]' ;
308352
309353describe ( 'CallDetail' , ( ) => {
0 commit comments