From 38ba8a5f4591cdb49ba53dd2f90da975040ed027 Mon Sep 17 00:00:00 2001 From: Andrea Franz Date: Tue, 13 Feb 2024 12:18:35 +0100 Subject: [PATCH] fix test --- .../projects/hooks/__tests__/useApplication.test.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/grant-explorer/src/features/projects/hooks/__tests__/useApplication.test.tsx b/packages/grant-explorer/src/features/projects/hooks/__tests__/useApplication.test.tsx index 0d66ba13d8..908fd5cbab 100644 --- a/packages/grant-explorer/src/features/projects/hooks/__tests__/useApplication.test.tsx +++ b/packages/grant-explorer/src/features/projects/hooks/__tests__/useApplication.test.tsx @@ -1,4 +1,5 @@ import { describe, Mock } from "vitest"; +import { DataLayer } from "data-layer"; import { useApplication } from "../useApplication"; import { renderWithContext } from "../../../../test-utils"; import { createElement } from "react"; @@ -20,7 +21,13 @@ describe("useApplication", () => { const variables = { chainId: 1, roundId: "1", id: "1" }; renderWithContext( createElement(() => { - const { data } = useApplication(variables, {}); + const dataLayer = new DataLayer({ + fetch: vi.fn().mockResolvedValue({}), + search: { baseUrl: "https://example.com" }, + indexer: { baseUrl: "https://example.com" }, + }); + + const { data } = useApplication(variables, dataLayer); if (data) { // Expect the hook to return the data expect(data).toEqual(applicationData.application);