diff --git a/apps/mobile/__tests__/animations.test.ts b/apps/mobile/__tests__/animations.test.ts index d5c1658..18cb7ab 100644 --- a/apps/mobile/__tests__/animations.test.ts +++ b/apps/mobile/__tests__/animations.test.ts @@ -51,4 +51,17 @@ describe('Animation Functions', () => { expect(result).toEqual({ type: 'spring', val: 50, config: SpringPresets.gentle }); }); }); + + describe('fadeInDelayed', () => { + test('should call withDelay and withTiming with correct parameters', () => { + const targetValue = 1; + const delayMs = 300; + + fadeInDelayed(targetValue, delayMs); + + expect(withTiming).toHaveBeenCalledWith(targetValue, TimingPresets.normal); + // withTiming mock returns the value itself, so withDelay gets the targetValue as second arg + expect(withDelay).toHaveBeenCalledWith(delayMs, targetValue); + }); + }); }); diff --git a/apps/mobile/jest.setup.js b/apps/mobile/jest.setup.js index f6fd815..e67f21a 100644 --- a/apps/mobile/jest.setup.js +++ b/apps/mobile/jest.setup.js @@ -6,8 +6,16 @@ jest.mock('react-native-reanimated', () => { return { useSharedValue: jest.fn(() => ({ value: 0 })), useAnimatedStyle: jest.fn(() => ({})), - withSpring: jest.fn((val) => val), - withTiming: jest.fn((val) => val), + withSpring: jest.fn((val, config) => val), + withTiming: jest.fn((val, config) => val), + withDelay: jest.fn((delay, val) => val), + withSequence: jest.fn((...args) => args), + Easing: { + out: jest.fn((val) => val), + inOut: jest.fn((val) => val), + quad: 'quad', + cubic: 'cubic', + }, createAnimatedComponent: jest.fn((Component) => Component), default: { View: 'View',