diff options
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/pages/LandingPage.test.tsx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/tests/pages/LandingPage.test.tsx b/src/tests/pages/LandingPage.test.tsx index b2a5142..908feed 100644 --- a/src/tests/pages/LandingPage.test.tsx +++ b/src/tests/pages/LandingPage.test.tsx @@ -25,8 +25,12 @@ const testingForm: forms.Form = { submitted_text: null }; +jest.mock("../../api/forms", () => ({ + ...jest.requireActual("../../api/forms"), + getForms: jest.fn(() => Promise.resolve([testingForm])) +})); + test("renders landing page", async () => { - jest.spyOn(forms, "getForms").mockImplementation(() => Promise.resolve([testingForm])); act(() => { render(<LandingPage/>, {wrapper: MemoryRouter}); }); const headerBar = await screen.findByText(/Python Discord Forms/); expect(headerBar).toBeInTheDocument(); |