Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
gravityblast committed Feb 13, 2024
1 parent d69ec60 commit 38ba8a5
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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);
Expand Down

0 comments on commit 38ba8a5

Please sign in to comment.