mirror of
https://github.com/usatiuk/photos.git
synced 2025-10-28 23:37:48 +01:00
33 lines
771 B
TypeScript
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();
|
|
});
|
|
});
|