diff --git a/src/components/campaign/opsSync/opsDomainOutbox.ts b/src/components/campaign/opsSync/opsDomainOutbox.ts index f932e63c..8ca0a981 100644 --- a/src/components/campaign/opsSync/opsDomainOutbox.ts +++ b/src/components/campaign/opsSync/opsDomainOutbox.ts @@ -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, diff --git a/src/components/campaign/opsSync/opsMunicipalityOutbox.ts b/src/components/campaign/opsSync/opsMunicipalityOutbox.ts index 190286d4..f8f7198c 100644 --- a/src/components/campaign/opsSync/opsMunicipalityOutbox.ts +++ b/src/components/campaign/opsSync/opsMunicipalityOutbox.ts @@ -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, diff --git a/tests/e2e/campaignLeaderships.e2e.spec.ts b/tests/e2e/campaignLeaderships.e2e.spec.ts index f6fa4f83..2a311546 100644 --- a/tests/e2e/campaignLeaderships.e2e.spec.ts +++ b/tests/e2e/campaignLeaderships.e2e.spec.ts @@ -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( diff --git a/tests/e2e/campaignMunicipalities.e2e.spec.ts b/tests/e2e/campaignMunicipalities.e2e.spec.ts index d6756add..64b5e9b6 100644 --- a/tests/e2e/campaignMunicipalities.e2e.spec.ts +++ b/tests/e2e/campaignMunicipalities.e2e.spec.ts @@ -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(), ])