From d8b88f3f84bbe25a3be785699394c5fb2b685d79 Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Wed, 3 Jun 2026 18:37:01 -0700 Subject: [PATCH] test(dashboard): mock useToast in PlanningModeModal.ui-interactions These tests render PlanningModeModal bare; it calls useToast() which throws without a ToastProvider. Mirror the mock already in PlanningModeModal.autosize. test.tsx. (Pre-existing failure on main; the test is excluded from the CI quality shards but fails under `--project dashboard-app`/`test:app`.) Co-Authored-By: Claude Opus 4.8 (1M context) --- .../PlanningModeModal.ui-interactions.test.tsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/dashboard/app/components/__tests__/PlanningModeModal.ui-interactions.test.tsx b/packages/dashboard/app/components/__tests__/PlanningModeModal.ui-interactions.test.tsx index cf5b5f2427..868fc60362 100644 --- a/packages/dashboard/app/components/__tests__/PlanningModeModal.ui-interactions.test.tsx +++ b/packages/dashboard/app/components/__tests__/PlanningModeModal.ui-interactions.test.tsx @@ -1,5 +1,15 @@ import { describe, it, expect, vi, beforeEach } from "vitest"; +// PlanningModeModal calls useToast(), which throws without a ToastProvider. +// These tests render it bare, so mock the hook (mirrors PlanningModeModal.autosize.test.tsx). +vi.mock("../../hooks/useToast", () => ({ + useToast: () => ({ + addToast: vi.fn(), + removeToast: vi.fn(), + toasts: [], + }), +})); + vi.mock("../../hooks/useNavigationHistory", async (importOriginal) => { const actual = await importOriginal(); return {