diff --git a/tests/unit/campaignWizardShell.unit.spec.tsx b/tests/unit/campaignWizardShell.unit.spec.tsx index 0f6524bd..52f0ab8c 100644 --- a/tests/unit/campaignWizardShell.unit.spec.tsx +++ b/tests/unit/campaignWizardShell.unit.spec.tsx @@ -2,6 +2,7 @@ import { cleanup, render, screen, within } from '@testing-library/react' import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest' vi.mock('next/navigation', () => ({ + usePathname: () => '/campanha/acoes/atualizar-votos', useRouter: () => ({ push: vi.fn(), replace: vi.fn(), @@ -9,6 +10,7 @@ vi.mock('next/navigation', () => ({ })) import { CampaignWizardShell } from '@/components/campaign/shared/CampaignWizardShell' +import { CampaignPageChromeProvider } from '@/components/campaign/shell/CampaignPageChromeContext' import { CampaignMobileTopBar } from '@/components/campaign/shell/CampaignMobileTopBar' import { CampaignWizardChromeProvider } from '@/components/campaign/shell/CampaignWizardChromeContext' import { SidebarProvider } from '@/components/ui/Sidebar' @@ -18,10 +20,12 @@ import { stubMatchMedia } from '../helpers/matchMedia' const renderWizardShell = (props: React.ComponentProps) => render( - - - - + + + + + + , ) @@ -104,35 +108,39 @@ describe('CampaignWizardShell', () => { it('skips title focus when contentFocus is none', () => { const { rerender } = render( - - - - - - + + + + + + + + , ) rerender( - - - - - - + + + + + + + + , ) @@ -144,33 +152,37 @@ describe('CampaignWizardShell', () => { it('moves focus to the step title when stepTitle changes', () => { const { rerender } = render( - - - - Corpo - - + + + + + Corpo + + + , ) rerender( - - - - Corpo - - + + + + + Corpo + + + , ) diff --git a/tests/unit/wizardNavigationPending.unit.spec.tsx b/tests/unit/wizardNavigationPending.unit.spec.tsx index 277dc4ae..ec08b330 100644 --- a/tests/unit/wizardNavigationPending.unit.spec.tsx +++ b/tests/unit/wizardNavigationPending.unit.spec.tsx @@ -9,6 +9,7 @@ const routerState = vi.hoisted(() => ({ vi.mock('next/navigation', async (importActual) => ({ ...(await importActual()), + usePathname: () => '/campanha/acoes/atualizar-votos', useRouter: () => ({ push: (...args: unknown[]) => routerState.push(...args), replace: vi.fn(), @@ -17,6 +18,7 @@ vi.mock('next/navigation', async (importActual) => ({ import { CampaignListPendingBoundary } from '@/components/campaign/shared/CampaignListPending' import { CampaignWizardShell } from '@/components/campaign/shared/CampaignWizardShell' +import { CampaignPageChromeProvider } from '@/components/campaign/shell/CampaignPageChromeContext' import { CampaignMobileTopBar } from '@/components/campaign/shell/CampaignMobileTopBar' import { CampaignWizardChromeProvider } from '@/components/campaign/shell/CampaignWizardChromeContext' import { SidebarProvider } from '@/components/ui/Sidebar' @@ -26,10 +28,11 @@ import { stubMatchMedia } from '../helpers/matchMedia' const mountWizardNavigation = () => render( - - - - + + + + + , )