teqo-backup/tests/unit
Francisco Ignácio Fontoura Solla 155f6492d9 B17: column picker on the seven CampaignTable list surfaces.
The picker shipped as a capability of CampaignTable rather than a municípios
feature, so every list that already uses the shared table got it: pass
`columnVisibility` and the table mounts the menu and filters the columns.

Persistence is a cookie, not localStorage, and the reason is a type rather
than a preference: CampaignTableColumn.cell is a function, so the column array
never crosses the server/client boundary and the client cannot rebuild the
table without it. The server filters, so a hidden column does not reach the RSC
payload either. `campaign_columns` carries a listId -> hidden ids map in a
compact form with no JSON and no percent-encoding, because document.cookie and
Next's cookies() disagree about decoding.

Closing the menu is the commit. The first cut debounced at 400 ms, which
batches a burst rather than a reading pace, so unchecking four columns while
reading their labels was four full-route refreshes — on /campanha/liderancas
each one re-pays the ~229 ms / 371-statement render already ledgered P1. The
timer survives at 3 s as a safety net for a menu left open; the price is that
the table behind the menu no longer updates per checkbox.

`defaultVisible` is gone: it was true on 10 columns and false on none, and
storing only the hidden set is what makes a newly shipped column visible to
everyone who never touched the picker. In exchange `label` is required, which
made `head` optional — 24 columns had a head that only restated the new label.
Each surface declares one mandatory column, re-filtered on the server so a
stale cookie cannot leave a row without its only linked cell.

The bug review caught is this codebase's recurring one: the RSC payload of
toggle A arrives inside the window of toggle B, and adopting the server there
undid B and then committed the set without it. Reconciliation now runs only
when no write is pending, pinned red against the previous code.

Municipality column ids are typed against MunicipalityListColumnId now, so the
id, the B22 description and the picker label are one key; the union member
`nivel` was renamed `level` to match the id and the ?level= filter. The
picker's own content comparison is sameIdSet, widened to string ids.
2026-07-28 08:25:16 -03:00
..
activityUi.unit.spec.ts C13: renomeia "Plano de Acao" para "Atividade" em toda a vertical /campanha 2026-07-25 20:50:38 -03:00
advisorSchema.unit.spec.ts B19: Gerenciar assessores (/campanha/assessores) 2026-07-25 02:40:47 -03:00
bahiaElectionAggregates.unit.spec.ts B13: escala relativa no mapa dos Municipios (quantis/LQ/posicao) + artefato TSE v3 2026-07-26 04:22:56 -03:00
bahiaMapStyle.unit.spec.ts B8+: escala das malhas em unidades reais, contrato do map key e degradacao 2026-07-27 01:59:36 -03:00
campaignActionContext.unit.spec.ts B19: Gerenciar assessores (/campanha/assessores) 2026-07-25 02:40:47 -03:00
campaignAuthCookie.unit.spec.ts Add remembered campaign sessions 2026-07-27 08:57:26 -03:00
campaignAuthMemoization.unit.spec.ts Ship /campanha nuclei MVP with RBAC, invites, and vote estimates. 2026-07-18 15:01:56 -03:00
campaignCellAutosave.unit.spec.ts B32+: share the campaign JSON route wrapper, fetch helper and cell auto-save. 2026-07-28 08:07:29 -03:00
campaignCellEditOverlay.unit.spec.ts B32+: share the campaign JSON route wrapper, fetch helper and cell auto-save. 2026-07-28 08:07:29 -03:00
campaignColumnPicker.unit.spec.ts B17: column picker on the seven CampaignTable list surfaces. 2026-07-28 08:25:16 -03:00
campaignColumnVisibility.unit.spec.ts B17: column picker on the seven CampaignTable list surfaces. 2026-07-28 08:25:16 -03:00
campaignComponents.unit.spec.ts E14: engagement levels N0-N4 and the first allocationDecision writer. 2026-07-27 21:19:33 -03:00
campaignCompositionCleanup.unit.spec.ts E13: visit eligibility checklist and the tour composer. 2026-07-27 21:04:04 -03:00
campaignConsent.unit.spec.ts Tooling: prettier como autoridade de formatacao (organize-imports deterministico, scripts format/format:check, normalizacao mecanica de 312 arquivos; artefatos gerados e migrations excluidos via .prettierignore) 2026-07-25 17:22:20 -03:00
campaignEntityListParsers.unit.spec.ts Deliver B29: header sort and filters on the leaderships list. 2026-07-28 01:43:44 -03:00
campaignFormActions.unit.spec.ts Pass 2 W4d: runCampaignFormAction (stay-on-page) fecha o C8 F4 2026-07-25 15:33:19 -03:00
campaignGeolocation.unit.spec.ts B14: municipio mais proximo (atalho geo no Inicio staff) 2026-07-26 17:33:33 -03:00
campaignIntelligenceConcepts.unit.spec.ts B22: explicacao por coluna no header das listas — description em CampaignTableHead/MunicipalitySortableHead, campaignConceptOneLiner como fonte unica E18, municipalityColumnDescriptions cobrindo as 11 colunas de /campanha/municipios 2026-07-26 02:58:54 -03:00
campaignInviteArchitecture.unit.spec.ts Tooling: prettier como autoridade de formatacao (organize-imports deterministico, scripts format/format:check, normalizacao mecanica de 312 arquivos; artefatos gerados e migrations excluidos via .prettierignore) 2026-07-25 17:22:20 -03:00
campaignInviteInteractions.unit.spec.ts B30: convite WhatsApp na lista de lideranças 2026-07-26 20:47:11 -03:00
campaignInviteOrigin.unit.spec.ts Tooling: prettier como autoridade de formatacao (organize-imports deterministico, scripts format/format:check, normalizacao mecanica de 312 arquivos; artefatos gerados e migrations excluidos via .prettierignore) 2026-07-25 17:22:20 -03:00
campaignJsonMutationRoute.unit.spec.ts B32+: share the campaign JSON route wrapper, fetch helper and cell auto-save. 2026-07-28 08:07:29 -03:00
campaignListFilterNavigation.unit.spec.ts B33+: close the /simplify rounds on the shared list filter hook 2026-07-27 09:39:15 -03:00
campaignListUrl.unit.spec.ts C13: renomeia "Plano de Acao" para "Atividade" em toda a vertical /campanha 2026-07-25 20:50:38 -03:00
campaignLoginAction.unit.spec.ts Add remembered campaign sessions 2026-07-27 08:57:26 -03:00
campaignMigrationSafety.unit.spec.ts Tooling: prettier como autoridade de formatacao (organize-imports deterministico, scripts format/format:check, normalizacao mecanica de 312 arquivos; artefatos gerados e migrations excluidos via .prettierignore) 2026-07-25 17:22:20 -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 Pass 2 W2: components/campaign em subpastas por dominio 2026-07-25 14:52:17 -03:00
campaignTable.unit.spec.ts B17: column picker on the seven CampaignTable list surfaces. 2026-07-28 08:25:16 -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 Tooling: prettier como autoridade de formatacao (organize-imports deterministico, scripts format/format:check, normalizacao mecanica de 312 arquivos; artefatos gerados e migrations excluidos via .prettierignore) 2026-07-25 17:22:20 -03:00
codebaseConventions.unit.spec.ts B32+: share the campaign JSON route wrapper, fetch helper and cell auto-save. 2026-07-28 08:07:29 -03:00
contactCityMigration.unit.spec.ts Tooling: prettier como autoridade de formatacao (organize-imports deterministico, scripts format/format:check, normalizacao mecanica de 312 arquivos; artefatos gerados e migrations excluidos via .prettierignore) 2026-07-25 17:22:20 -03:00
dashboardPriorityMunicipalities.unit.spec.ts B20: municípios prioritários no Início com déficit E9 e CTA para a lista. 2026-07-25 20:01:51 -03:00
electionPartySpectrum.unit.spec.ts Pass 2 W4a: electionInsights.ts deletado (941 linhas, 71 exports, 2 vivos) 2026-07-25 14:57:49 -03:00
electionResults.unit.spec.ts Tooling: prettier como autoridade de formatacao (organize-imports deterministico, scripts format/format:check, normalizacao mecanica de 312 arquivos; artefatos gerados e migrations excluidos via .prettierignore) 2026-07-25 17:22:20 -03:00
engagementLevel.unit.spec.ts E14: engagement levels N0-N4 and the first allocationDecision writer. 2026-07-27 21:19:33 -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 Pass 2 W2: correcoes de fronteira lib/utilities e client boundary 2026-07-25 14:38:41 -03:00
leadershipListUrl.unit.spec.ts Deliver B29: header sort and filters on the leaderships list. 2026-07-28 01:43:44 -03:00
leadershipMunicipalityMembership.unit.spec.ts B34: editable município chips on the leaderships list. 2026-07-27 22:35:19 -03:00
leadershipStateDeputyMembership.unit.spec.ts B31: coluna de dobradinhas na lista de lideranças 2026-07-26 19:50:15 -03:00
mapScaleClasses.unit.spec.ts simplify(B13): corrige classe agregada, bolhas em pane proprio e registra debitos 2026-07-26 05:12:37 -03:00
municipalityAdvisorMembership.unit.spec.ts B27: combobox + chips + auto-save no popover de Assessores da lista de municípios 2026-07-26 03:31:51 -03:00
municipalityGeographyParts.unit.spec.ts B25: link do território na lista de municípios 2026-07-26 18:59:49 -03:00
municipalityList.unit.spec.ts E14: engagement levels N0-N4 and the first allocationDecision writer. 2026-07-27 21:19:33 -03:00
municipalityMapNavigation.unit.spec.ts B8+: escala das malhas em unidades reais, contrato do map key e degradacao 2026-07-27 01:59:36 -03:00
municipalityPortfolio.unit.spec.ts B34: editable município chips on the leaderships list. 2026-07-27 22:35:19 -03:00
municipalityPortfolioCell.unit.spec.ts Adopt B42's cell-edit overlay in B34 and fix the optimistic baseline again. 2026-07-27 23:59:20 -03:00
municipalityPotential.unit.spec.ts Tooling: prettier como autoridade de formatacao (organize-imports deterministico, scripts format/format:check, normalizacao mecanica de 312 arquivos; artefatos gerados e migrations excluidos via .prettierignore) 2026-07-25 17:22:20 -03:00
municipalityProximity.unit.spec.ts simplify(B14): corrige o mecanismo da fronteira, estado unsupported e duplicatas 2026-07-26 18:03:44 -03:00
municipalityStaffVoteTotal.unit.spec.ts Tooling: prettier como autoridade de formatacao (organize-imports deterministico, scripts format/format:check, normalizacao mecanica de 312 arquivos; artefatos gerados e migrations excluidos via .prettierignore) 2026-07-25 17:22:20 -03:00
municipalityTerritorialClass.unit.spec.ts simplify(B13): corrige classe agregada, bolhas em pane proprio e registra debitos 2026-07-26 05:12:37 -03:00
municipalityVoteRank.unit.spec.ts simplify(B13): corrige classe agregada, bolhas em pane proprio e registra debitos 2026-07-26 05:12:37 -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
payloadAdminRoles.unit.spec.ts Add users.roles so Payload /admin can separate editors from admins. 2026-07-27 01:54:29 -03:00
projectionSheetParse.unit.spec.ts Tooling: prettier como autoridade de formatacao (organize-imports deterministico, scripts format/format:check, normalizacao mecanica de 312 arquivos; artefatos gerados e migrations excluidos via .prettierignore) 2026-07-25 17:22:20 -03:00
recentVisits.unit.spec.ts C13 pos-simplify: fecha os residuos da varredura e estreita os guards 2026-07-25 21:29:32 -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
siteMetadata.unit.spec.ts Make public SEO resilient when the metadata global is empty. 2026-07-27 08:20:33 -03:00
stateDeputyListUrl.unit.spec.ts B33: ordenação e filtro no header da lista de dobradinhas 2026-07-26 16:21:40 -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
supporterUi.unit.spec.ts Pass 2 W0: pina contratos de URL e loaders das listas + truth-up TESTING/TECH-DEBT 2026-07-25 13:30:39 -03:00
territoryAnchor.unit.spec.ts B25: link do território na lista de municípios 2026-07-26 18:59:49 -03:00
territoryListUrl.unit.spec.ts B21: cria página própria dos territórios 2026-07-25 21:50:24 -03:00
territoryOverview.unit.spec.ts E12: camada TI com rollups MAUP e benchmark intra-TI. 2026-07-26 21:26:47 -03:00
visitEligibility.unit.spec.ts E13: visit eligibility checklist and the tour composer. 2026-07-27 21:04:04 -03:00
voteEstimate.unit.spec.ts Tooling: prettier como autoridade de formatacao (organize-imports deterministico, scripts format/format:check, normalizacao mecanica de 312 arquivos; artefatos gerados e migrations excluidos via .prettierignore) 2026-07-25 17:22:20 -03:00
voteTrend.unit.spec.ts Pass 2 W4a: electionInsights.ts deletado (941 linhas, 71 exports, 2 vivos) 2026-07-25 14:57:49 -03:00