Files
photos/frontend/src/Photos/tests/Overview.test.tsx
2020-10-15 15:59:58 +03:00

33 lines
771 B
TypeScript

import * as React from "react";
import { shallow } from "enzyme";
import { IOverviewComponentProps, OverviewComponent } from "../Overview";
afterEach(() => {
jest.restoreAllMocks();
});
const fetchPhotosFn = jest.fn();
const overviewComponentDefaultProps: IOverviewComponentProps = {
photos: null,
overviewFetching: false,
overviewFetchingError: null,
overviewFetchingSpinner: false,
fetchPhotos: fetchPhotosFn,
};
describe("<Overview />", () => {
afterEach(() => {
jest.clearAllMocks();
});
it("should not crash and call fetchPhotos", () => {
const wrapper = shallow(
<OverviewComponent {...overviewComponentDefaultProps} />,
);
expect(fetchPhotosFn).toHaveBeenCalled();
});
});