OH14 — register mirror collections in offline executors + fix e2e POST waits

This commit is contained in:
Cursor Agent 2026-08-02 04:07:20 +00:00
parent ce8bf67828
commit ceb1b3a8af
No known key found for this signature in database
4 changed files with 9 additions and 3 deletions

View file

@ -129,6 +129,10 @@ const createDomainOfflineExecutor = (): OfflineExecutor =>
leadershipCreateOutbox: leadershipCreateOutboxCollection,
demandTransitionOutbox: demandTransitionOutboxCollection,
activityUpdateOutbox: activityUpdateOutboxCollection,
// Mirror rows touched in onMutate must be registered for persistence.
leaderships: leadershipsCollection,
demands: demandsCollection,
activities: activitiesCollection,
},
storage: new IndexedDBAdapter('teqo-ops-domain', 'outbox'),
beforeRetry: collapseAllDomainOutbox,

View file

@ -148,6 +148,8 @@ const createMunicipalityOfflineExecutor = (): OfflineExecutor =>
politicalTrendOutbox: politicalTrendOutboxCollection,
engagementLevelOutbox: engagementLevelOutboxCollection,
advisorsOutbox: advisorsOutboxCollection,
// Mirror rows touched in onMutate must be registered for persistence.
votePledges: votePledgesCollection,
},
storage: new IndexedDBAdapter('teqo-ops-municipality', 'outbox'),
beforeRetry: collapseAllMunicipalityOutbox,

View file

@ -50,12 +50,12 @@ test.describe('campaign leaderships list', () => {
await expect(statusPopover).toBeVisible()
await expect(statusPopover.getByRole('button', { name: 'Salvar' })).toHaveCount(0)
// Auto-save (150 ms debounce): wait for the actual POST response — the
// Auto-save (150 ms debounce): wait for the CAS server action POST — the
// badge text updates optimistically before the request even lands, so a
// text-only assertion here would race the reload below against a save
// that hasn't reached the database yet.
await Promise.all([
expectPostResponse(page, '/campanha/liderancas/support-status'),
expectPostResponse(page, '/campanha/liderancas'),
statusPopover.getByLabel('Status de apoio', { exact: true }).selectOption('engajado'),
])
await expect(page.getByRole('button', { name: 'Editar status de apoio' })).toContainText(

View file

@ -212,7 +212,7 @@ test.describe('Municípios — jornadas por papel', () => {
await trendPopover.getByLabel('Justificativa').fill(note)
await trendPopover.getByLabel('Tendência', { exact: true }).selectOption('favoravel')
await Promise.all([
expectPostResponse(page, '/campanha/municipios/political-trend'),
expectPostResponse(page, '/campanha/municipios'),
trendPopover.getByLabel('Justificativa').blur(),
])