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) <noreply@anthropic.com>
This commit is contained in:
@@ -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<typeof import("../../hooks/useNavigationHistory")>();
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user