expect(jest.fn()).toHaveBeenCalled()
Started 7 months ago by Dhanasekar in React Native
should call onPress handler when pressed expect(jest.fn()).toHaveBeenCalled() Expected number of calls: >=...
Body
should call onPress handler when pressed
expect(jest.fn()).toHaveBeenCalled()
Expected number of calls: >= 1
Received number of calls: 0
381 | );
382 | fireEvent.press(getByTestId('pressable-button'));
> 383 | expect(onPressMock).toHaveBeenCalled();
| ^
384 | });
385 | });
at Object.toHaveBeenCalled (__tests__/screen.test.tsx:383:29)
Tags: react native, test cases, jest test cases
-
No one is replied to this thread yet. Be first to reply!