I expect callback to return either true or false. I know how to test for function being called, but how to test if that function returned specific value? How can I do that using react testing libraries?
My code:
it('sends back error callback', () => {
const isError = (val) => val;
render(<Component callback={isError}/>);
const input = screen.getAllByRole('textbox')[0];
fireEvent.change(input, {target: {value: '100.98'}});
expect(isError).toHaveBeenCalledTimes(1);
})