From 13793e309201d4a16068629eaaedbadc3fe6ee12 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 2 Aug 2026 01:43:25 +0000 Subject: [PATCH] OH10: mock useRouter in cell overlay unit tests Advisors hybrid conflict path needs next/navigation; overlay container specs render without the App Router. Co-authored-by: Francisco Solla --- tests/unit/campaignCellEditOverlay.unit.spec.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/unit/campaignCellEditOverlay.unit.spec.ts b/tests/unit/campaignCellEditOverlay.unit.spec.ts index 4b2fdc50..bb106479 100644 --- a/tests/unit/campaignCellEditOverlay.unit.spec.ts +++ b/tests/unit/campaignCellEditOverlay.unit.spec.ts @@ -13,6 +13,14 @@ import { MunicipalityPortfolioCell } from '@/components/campaign/shared/Municipa import { TooltipProvider } from '@/components/ui/tooltip' import { toVoteEstimateScenarioViewModel } from '@/lib/voteEstimate' +vi.mock('next/navigation', () => ({ + useRouter: () => ({ + refresh: vi.fn(), + push: vi.fn(), + replace: vi.fn(), + }), +})) + /** * B42: the quick-edit cells of `/campanha/municipios` share one container * (`CampaignCellEditOverlay`) that is a Popover in the desktop table and a