I am trying to write a unit test using jest and react testing library. I want to test a function call inside the useEffect hook, but my test is not working. What do I need to do to pass the test successfully?
useEffect(() => {
getActiveFilters(filterValue);
// eslint-disable-next-line
}, [filterValue, dictionaries]);
Here my test
it('should call the [getActiveFilters] function', async () => {
const getActiveFilters = jest.fn();
await waitFor(() => expect(getActiveFilters).toHaveBeenCalled());
});
