Skip to content

Commit

Permalink
test : bugfix mock use toast
Browse files Browse the repository at this point in the history
  • Loading branch information
Happhee committed Aug 3, 2024
1 parent e2525c0 commit 771c189
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/shared/components/LinkShare/LinkShare.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@ import LinkShare from ".";
const href = "www.few.article.co.kr";

const mockToast = vi.fn();
vi.mock("@shared/components/ui/use-toast", () => {
vi.mock("@shared/components/ui/use-toast", async () => {
const actual = await vi.importActual<
typeof import("@shared/components/ui/use-toast")
>("@shared/components/ui/use-toast");
return {
...actual,
useToast: () => ({
toast: mockToast,
}),
Expand Down

0 comments on commit 771c189

Please sign in to comment.