diff --git a/src/components/campaign/opsSync/opsEstimateOutbox.ts b/src/components/campaign/opsSync/opsEstimateOutbox.ts index 1d193772..efc47909 100644 --- a/src/components/campaign/opsSync/opsEstimateOutbox.ts +++ b/src/components/campaign/opsSync/opsEstimateOutbox.ts @@ -93,15 +93,6 @@ const createEstimateOfflineExecutor = (): OfflineExecutor => }, }) -/** Test/DI seam — reset module singletons between unit cases. */ -export const resetOpsEstimateOutboxForTests = (): void => { - for (const key of [...opsEstimateOutboxCollection.keys()]) { - opsEstimateOutboxCollection.delete(key) - } - executorSingleton = null - initPromise = null -} - export const getOpsEstimateOfflineExecutor = async (): Promise => { if (executorSingleton) { await executorSingleton.waitForInit() @@ -131,15 +122,8 @@ export const enqueueEstimateVotes = async (input: EnqueueEstimateVotesInput): Pr variables.baseEstimatedAt !== undefined ? variables.baseEstimatedAt : (mirrorRow?.estimatedAt ?? null) - const next = toOpsEstimateOutboxRow( - { ...variables, baseEstimatedAt }, - 'pending', - ) - patchOpsVotePledgeEstimateOptimistic( - next.pledgeId, - next.estimatedVotes, - next.estimateNote, - ) + const next = toOpsEstimateOutboxRow({ ...variables, baseEstimatedAt }, 'pending') + patchOpsVotePledgeEstimateOptimistic(next.pledgeId, next.estimatedVotes, next.estimateNote) if (opsEstimateOutboxCollection.has(next.pledgeId)) { opsEstimateOutboxCollection.update(next.pledgeId, (draft) => { draft.estimatedVotes = next.estimatedVotes diff --git a/src/components/campaign/opsSync/opsMirrorClient.ts b/src/components/campaign/opsSync/opsMirrorClient.ts index 1fbf99f8..713debe0 100644 --- a/src/components/campaign/opsSync/opsMirrorClient.ts +++ b/src/components/campaign/opsSync/opsMirrorClient.ts @@ -8,6 +8,10 @@ import { type OpsMirrorPersistenceMode, type OpsMirrorStore, } from '@/components/campaign/opsSync/opsMirrorPersistence' +import { + mapVotePledgeWriteToOps, + type VotePledgeEstimateWriteResult, +} from '@/lib/campaignOps/mapVotePledgeWriteToOps' import { createEmptyOpsSnapshot, type OpsActivity, @@ -22,10 +26,6 @@ import { type OpsStateDeputy, type OpsVotePledge, } from '@/lib/campaignOps/opsContract' -import { - mapVotePledgeWriteToOps, - type VotePledgeEstimateWriteResult, -} from '@/lib/campaignOps/mapVotePledgeWriteToOps' import { mergeOpsSnapshot } from '@/lib/campaignOps/opsMerge' import { OPS_MIRROR_SCHEMA_VERSION } from '@/lib/campaignOps/opsMirrorVersion' import type { OpsSyncState } from '@/lib/campaignOps/opsSyncMeta' diff --git a/src/components/campaign/votePledge/PledgeEstimateForm.tsx b/src/components/campaign/votePledge/PledgeEstimateForm.tsx index ecee325a..84a177dd 100644 --- a/src/components/campaign/votePledge/PledgeEstimateForm.tsx +++ b/src/components/campaign/votePledge/PledgeEstimateForm.tsx @@ -106,11 +106,7 @@ export const PledgeEstimateForm = ({ ) } - return ( - - ) + return } const LegacyPledgeEstimateForm = ({