Skip to content

Commit

Permalink
fix(tests): typecast filter IDs to FilterId in hooks tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lawvs committed Sep 22, 2024
1 parent 21ad7a9 commit 49d4956
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/filter/src/__tests__/hooks.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable react-hooks/rules-of-hooks */
import type { FilterId } from "@fn-sphere/core";
import { renderHook } from "@testing-library/react";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { z } from "zod";
Expand All @@ -22,15 +23,15 @@ vi.mock(import("@fn-sphere/core"), async (importOriginal) => {
// replace some exports
createSingleFilter: vi.fn((ruleInput) => ({
...mod.createSingleFilter(ruleInput),
id: String(id++),
id: String(id++) as FilterId,
})),
createFilterGroup: vi.fn((groupInput) => ({
...mod.createFilterGroup(groupInput),
id: String(id++),
id: String(id++) as FilterId,
})),
createDefaultRule: vi.fn((fields) => ({
...mod.createDefaultRule(fields),
id: String(id++),
id: String(id++) as FilterId,
})),
};
});
Expand Down

0 comments on commit 49d4956

Please sign in to comment.