2

I have following tests:

describe('if initialized', () => {
  const loadProjects = jest.fn();
  let tree: ReactTestRenderer | null;
  renderer.act(() => {
    tree = renderer.create(
      <I18nextProvider i18n={i18n}>
        <EstimatesTablePure
          projects={ROWS}
          limit={10}
          loadingProjects={false}
          loadProjects={loadProjects}
        />
      </I18nextProvider>,
    );
  });

  it('should render content', () => {
    expect(tree!!.toJSON()).toMatchSnapshot();
  });

  it('should call loadProjects', () => {
    expect(loadProjects).toBeCalledTimes(1);
  });

});

and I got following error:

enter image description here

I was looking for the solution and found that: https://github.com/mui-org/material-ui/issues/9243 but still do not have idea how to solve that.

Tomasz Waszczyk
  • 2,680
  • 5
  • 35
  • 73

0 Answers0