From 989e3abab89ff5ab130f21660ef60a137b0fdbaf Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Sun, 2 Aug 2026 23:05:09 +0000 Subject: [PATCH] Format B135 wizard back navigation files --- .../campaign/municipality/WizardTrendNoteStep.tsx | 4 +--- .../campaign/shared/WizardExpectedVotesStep.tsx | 4 +--- src/lib/wizardActionChain.ts | 11 +++++++++-- tests/unit/wizardActionChain.unit.spec.ts | 4 +--- 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/components/campaign/municipality/WizardTrendNoteStep.tsx b/src/components/campaign/municipality/WizardTrendNoteStep.tsx index 3acbc294..f3d0e969 100644 --- a/src/components/campaign/municipality/WizardTrendNoteStep.tsx +++ b/src/components/campaign/municipality/WizardTrendNoteStep.tsx @@ -61,9 +61,7 @@ export const WizardTrendNoteStep = ({ useCampaignFormSuccessToast(state, () => { recordLastActedMunicipality(municipalitySlug) const sessionEntry = resolveWizardChainEntry(entryAction, 'change-trend') - router.push( - wizardChainContinueHref(sessionEntry, 'change-trend', municipalitySlug, returnPath), - ) + router.push(wizardChainContinueHref(sessionEntry, 'change-trend', municipalitySlug, returnPath)) }) return ( diff --git a/src/components/campaign/shared/WizardExpectedVotesStep.tsx b/src/components/campaign/shared/WizardExpectedVotesStep.tsx index 933f07e8..a20b725b 100644 --- a/src/components/campaign/shared/WizardExpectedVotesStep.tsx +++ b/src/components/campaign/shared/WizardExpectedVotesStep.tsx @@ -85,9 +85,7 @@ export const WizardExpectedVotesStep = ({ const continueAfterVotes = () => { const sessionEntry = resolveWizardChainEntry(entryAction, 'update-votes') - router.push( - wizardChainContinueHref(sessionEntry, 'update-votes', municipalitySlug, returnPath), - ) + router.push(wizardChainContinueHref(sessionEntry, 'update-votes', municipalitySlug, returnPath)) } const handleConfirm = () => { diff --git a/src/lib/wizardActionChain.ts b/src/lib/wizardActionChain.ts index 2a382d76..7b5a2090 100644 --- a/src/lib/wizardActionChain.ts +++ b/src/lib/wizardActionChain.ts @@ -6,11 +6,11 @@ import { CAMPAIGN_WIZARD_ACTION_SLUGS, campaignWizardActionIdForSlug, - type CampaignWizardActionId, isWizardReturnPath, wizardActionHref, wizardSignalHref, wizardTrendHref, + type CampaignWizardActionId, } from '@/lib/campaignActionRoutes' import { CAMPAIGN_HOME } from '@/lib/campaignPaths' @@ -198,7 +198,14 @@ export const wizardPreviousHref = (input: WizardPreviousHrefInput): string => { } if (stepKind === 'trend-note') { - return wizardTrendHref(actionSlug, municipalitySlug, undefined, entryAction, undefined, returnPath) + return wizardTrendHref( + actionSlug, + municipalitySlug, + undefined, + entryAction, + undefined, + returnPath, + ) } if (stepKind === 'signal-body') { diff --git a/tests/unit/wizardActionChain.unit.spec.ts b/tests/unit/wizardActionChain.unit.spec.ts index 5f3d6f74..c821f1a1 100644 --- a/tests/unit/wizardActionChain.unit.spec.ts +++ b/tests/unit/wizardActionChain.unit.spec.ts @@ -132,9 +132,7 @@ describe('wizardActionChain', () => { municipalitySlug: 'cairu', entryAction: 'update-votes', }), - ).toBe( - `${CAMPAIGN_ACTIONS_HOME}/mudar-tendencia?municipio=cairu&entry=update-votes`, - ) + ).toBe(`${CAMPAIGN_ACTIONS_HOME}/mudar-tendencia?municipio=cairu&entry=update-votes`) expect( wizardPreviousHref({ actionSlug: 'atualizar-lideranca',