diff --git a/frontend/src/Photos/Overview.tsx b/frontend/src/Photos/Overview.tsx index 7bbebaf..322aa17 100644 --- a/frontend/src/Photos/Overview.tsx +++ b/frontend/src/Photos/Overview.tsx @@ -33,7 +33,6 @@ export const OverviewComponent: React.FunctionComponent return (
- {" "}
{photos}
); diff --git a/frontend/src/Photos/tests/Overview.test.tsx b/frontend/src/Photos/tests/Overview.test.tsx index bea70e6..a66b008 100644 --- a/frontend/src/Photos/tests/Overview.test.tsx +++ b/frontend/src/Photos/tests/Overview.test.tsx @@ -7,20 +7,26 @@ afterEach(() => { jest.restoreAllMocks(); }); +const fetchPhotosFn = jest.fn(); + const overviewComponentDefaultProps: IOverviewComponentProps = { photos: null, fetching: false, fetchingError: null, fetchingSpinner: false, - fetchPhotos: jest.fn(), + fetchPhotos: fetchPhotosFn, }; describe("", () => { - it("should not crash", () => { + afterEach(() => { + jest.clearAllMocks(); + }); + + it("should not crash and call fetchPhotos", () => { const wrapper = shallow( , ); - expect(wrapper.contains("Overview!")).toBeTruthy(); + expect(fetchPhotosFn).toHaveBeenCalled(); }); });