teqo-backup/tests/unit
Francisco Ignácio Fontoura Solla 31fcc20ffd E9 /simplify: consolidate duplicated helpers, dead passthrough, comment drift
Cross-checked by parallel code-quality/performance/reuse reviewers against
the E9 commit. Behavior-preserving:

- laterTimestamp/resolveMunicipalityLastSignalAt were the same "latest of
  two ISO timestamps" written twice; both now delegate to a new
  latestIsoTimestamp in campaignTime.ts, which documents the fixed-width
  UTC invariant that makes the string compare sound.
- Hoisted the frescor comparator's Date.now() out of the per-comparison
  accessor so the sort key stops drifting mid-sort.
- Deleted the unread baseTotal/growthFactor/belowBase passthrough from the
  statewide goal entry point and fixed a comment citing a symbol
  (goalDecompositionBelowBase) that never existed; renamed
  computeStatewideGoalDecomposition -> computeStatewideSuggestedGoals now
  that nothing is proportionally decomposed.
- Collapsed the advisor badge's two copies (desktop table vs mobile card)
  into one AdvisorStatusBadge; they had quietly diverged on which icon
  renders for the "no advisor" state.
- Renamed the sort-menu's stale "Cobertura" label for advisor coverage to
  "Assessoria" (E8 already renamed the list column for the same reason);
  derived the sort-key set from the label record instead of a third
  parallel list.
- Consolidated three zeroed-scenario-record literals into one
  zeroByVoteEstimateScenario() factory in voteEstimate.ts.
- Routed three separate votesByYear[2022] reads through one votesInYear
  helper in municipalityPotential.ts.
- Gated the goal card's empty-state copy on !usesMesaEstimate so it stops
  telling a município with an existing mesa estimate to enter one.
- Swapped a test assertion pinned to a raw Tailwind token for a stable
  data-signal="cold" hook, and tightened the "desert" test's bound to
  check against the actual growth factor (the old bound was true for
  every slug regardless of the formula).

Left alone (roadmap decision, not cleanup): sanityCheckSuggestedGoalsByTerritory
has no production caller yet (deferred to E11/E12); comment shortened
instead of deleting the dead-but-documented code.

Verified: tsc --noEmit, pnpm lint (0 warnings), 337 unit + 366 integration
tests, pnpm build all green.
2026-07-25 02:24:18 -03:00
..
bahiaElectionAggregates.unit.spec.ts E8: Conta da cadeira (metas derivadas, potencial por município, cobertura) 2026-07-24 22:54:27 -03:00
bahiaMapStyle.unit.spec.ts Deliver B12 map viewport fit and hover fixes for filtered Praças. 2026-07-21 18:10:32 -03:00
campaignActionContext.unit.spec.ts Add the tooling gate: knip, CI, zero-warning lint, as-never ban 2026-07-23 23:06:12 -03:00
campaignAuthMemoization.unit.spec.ts Ship /campanha nuclei MVP with RBAC, invites, and vote estimates. 2026-07-18 15:01:56 -03:00
campaignComponents.unit.spec.ts E9 /simplify: consolidate duplicated helpers, dead passthrough, comment drift 2026-07-25 02:24:18 -03:00
campaignCompositionCleanup.unit.spec.ts Remodel /campanha around predefined Praças replacing electoral nuclei. 2026-07-21 02:28:00 -03:00
campaignConsent.unit.spec.ts Add C2 nominal supporter registry for /campanha. 2026-07-18 20:32:54 -03:00
campaignIntelligenceConcepts.unit.spec.ts E18: documentação de conceitos de inteligência de campanha 2026-07-25 01:37:37 -03:00
campaignInviteArchitecture.unit.spec.ts Remodel /campanha around predefined Praças replacing electoral nuclei. 2026-07-21 02:28:00 -03:00
campaignInviteInteractions.unit.spec.ts Remodel /campanha around predefined Praças replacing electoral nuclei. 2026-07-21 02:28:00 -03:00
campaignInviteOrigin.unit.spec.ts Ship /campanha nuclei MVP with RBAC, invites, and vote estimates. 2026-07-18 15:01:56 -03:00
campaignLoginAction.unit.spec.ts Show a distinct message when campaign login is temporarily locked. 2026-07-20 18:24:19 -03:00
campaignMigrationSafety.unit.spec.ts Ship /campanha nuclei MVP with RBAC, invites, and vote estimates. 2026-07-18 15:01:56 -03:00
campaignPasswordSchemas.unit.spec.ts Add campaign password reset, profile photo, and RS+ follow-up plan. 2026-07-19 05:26:56 -03:00
campaignPwa.unit.spec.ts Add installable PWA foundation for the /campanha field app. 2026-07-18 17:28:34 -03:00
campaignSearchInput.unit.spec.ts Ship /campanha nuclei MVP with RBAC, invites, and vote estimates. 2026-07-18 15:01:56 -03:00
campaignUserProfile.unit.spec.ts Add the tooling gate: knip, CI, zero-warning lint, as-never ban 2026-07-23 23:06:12 -03:00
campoParties.unit.spec.ts E8: Conta da cadeira (metas derivadas, potencial por município, cobertura) 2026-07-24 22:54:27 -03:00
choroplethPercentScale.unit.spec.ts Deliver B11 percent-of-valid-votes scale on Praças map. 2026-07-21 13:12:05 -03:00
contactCityMigration.unit.spec.ts Ship /campanha nuclei MVP with RBAC, invites, and vote estimates. 2026-07-18 15:01:56 -03:00
electionInsights.unit.spec.ts Deliver A5 mobilization insight and absorb E7 F2 int follow-up. 2026-07-19 22:34:35 -03:00
electionPartySpectrum.unit.spec.ts Deliver A5 ticket leverage and flip insights with simplify cleanup. 2026-07-19 17:34:06 -03:00
electionResults.unit.spec.ts E8 follow-up: touch-friendly metric tooltips, 2014/2018 majoritarian seed, E18 docs plan 2026-07-24 22:55:51 -03:00
facebookPixel.unit.spec.ts Add Meta Pixel tracking to public petition pages. 2026-07-21 10:51:47 -03:00
formatRelativeAge.unit.spec.ts Polish /campanha Field Desk UX and register FD+/FD2 follow-ups. 2026-07-19 08:17:12 -03:00
goalCoverage.unit.spec.ts E9: Fila de alocação (déficit como default do staff, frescor, coluna da vergonha) 2026-07-25 02:24:17 -03:00
municipalityMapNavigation.unit.spec.ts Remodel the campaign vertical from Praça to Município 2026-07-23 21:36:20 -03:00
municipalityPotential.unit.spec.ts E9 /simplify: consolidate duplicated helpers, dead passthrough, comment drift 2026-07-25 02:24:18 -03:00
municipalityStaffVoteTotal.unit.spec.ts Remodel the campaign vertical from Praça to Município 2026-07-23 21:36:20 -03:00
municipalityUi.unit.spec.ts E9: Fila de alocação (déficit como default do staff, frescor, coluna da vergonha) 2026-07-25 02:24:17 -03:00
municipalityVoteRank.unit.spec.ts A11: show municipality 2022 vote rank/share and default list sort by votos. 2026-07-24 18:40:56 -03:00
onda0ConsentTexts.unit.spec.ts Add pre-push typecheck hook and fix campaign avatar field access. 2026-07-19 12:10:59 -03:00
projectionSheetParse.unit.spec.ts Import projection-sheet strategy columns into municipalities (E4R fase 2) 2026-07-24 15:58:06 -03:00
recentVisits.unit.spec.ts Remodel the campaign vertical from Praça to Município 2026-07-23 21:36:20 -03:00
revalidateRequest.unit.spec.ts Add allowlisted global cache revalidation for Onda 0 F1. 2026-07-19 22:21:16 -03:00
signatureExport.unit.spec.ts Add admin CSV export for signatures and contacts. 2026-07-23 00:53:04 -03:00
supporterSchema.unit.spec.ts Add C6 scale/DRY for supporters: bulk import, KPI aggregate, shared shells. 2026-07-18 22:17:31 -03:00
territoryOverview.unit.spec.ts Add comparative Identity Territory table to campaign dashboard (E17) 2026-07-24 17:17:31 -03:00
voteEstimate.unit.spec.ts Remodel the campaign vertical from Praça to Município 2026-07-23 21:36:20 -03:00