teqo-backup/tests/helpers
Francisco Solla 29ed733190 fix(C92): calendar feed creation stripped by admin-only system fields
createCalendarFeedLinkRecord failed with `overrideAccess:false` +
`user: campaignUser` because Payload stripped the required
`secretSlug`/`createdBy` fields (create access was admin-only) -> 400
behind the generic message; revokeCalendarFeedRecord silently no-opped
(revokedAt update access also admin-only).

- canCreateCalendarFeed now enforces advisor filterMunicipality scope
  on data (canCreateSupporter precedent) + canSetCalendarFeedSecret /
  canSetCalendarFeedRevocation permit staff to mint the secret on create
  and mark a feed revoked; secret read stays `() => false` and update
  admin-only.
- CalendarFeed stamps createdBy via stampCampaignCreatedBy; secret
  create + revokedAt update use the new staff field accesses.
- Action refactored to `*Record` (payload, actor) cores + thin wrappers;
  assertFilterMunicipalityInScope (tour precedent); console.error keeps
  the real error on the server while the friendly message stays.
- 10 int tests for create/scope/revoke/leader/secret; fixture tracks
  calendarFeed cleanup.

Closes #436
2026-08-08 23:13:30 -03:00
..
assertTestDatabase.ts feat(worktree): ambientes isolados por worktree — porta própria, bancos próprios, migrations no provision 2026-08-08 11:33:07 -03:00
campaignFixtures.ts fix(C92): calendar feed creation stripped by admin-only system fields 2026-08-08 23:13:30 -03:00
distinctWordStartQuery.ts fix(test): queries distintas em specs de portfolio de município 2026-07-30 22:29:20 -03:00
featureBounds.ts B8+: escala das malhas em unidades reais, contrato do map key e degradacao 2026-07-27 01:59:36 -03:00
login.ts Ship /campanha nuclei MVP with RBAC, invites, and vote estimates. 2026-07-18 15:01:56 -03:00
matchMedia.ts B75: wizard mobile header chrome on Mandate Red bar. 2026-07-30 03:26:54 -03:00
seedUser.ts Add users.roles so Payload /admin can separate editors from admins. 2026-07-27 01:54:29 -03:00
serverOnly.ts Ship /campanha nuclei MVP with RBAC, invites, and vote estimates. 2026-07-18 15:01:56 -03:00
stub.ts Add the tooling gate: knip, CI, zero-warning lint, as-never ban 2026-07-23 23:06:12 -03:00
testDatabaseLease.ts A6 — Dobradinha 2026 automática quando o TSE publicar candidaturas (pós-15/08) (#82) 2026-07-31 00:14:27 -03:00
tseFixtures.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