diff --git a/packages/runtime/test/transport/identityDeletionPeerProcessing.test.ts b/packages/runtime/test/transport/identityDeletionPeerProcessing.test.ts index 6d10d113b..8634b97ea 100644 --- a/packages/runtime/test/transport/identityDeletionPeerProcessing.test.ts +++ b/packages/runtime/test/transport/identityDeletionPeerProcessing.test.ts @@ -43,6 +43,7 @@ describe("IdentityDeletionProcess", () => { await services1.transport.identityDeletionProcesses.initiateIdentityDeletionProcess(); await syncUntilHasEvent(services2, PeerToBeDeletedEvent, (e) => e.data.id === relationshipId); + await services2.eventBus.waitForRunningEventHandlers(); const updatedRelationship = (await services2.transport.relationships.getRelationship({ id: relationshipId })).value; expect(updatedRelationship.peerDeletionInfo!.deletionStatus).toBe(PeerDeletionStatus.ToBeDeleted); @@ -53,6 +54,7 @@ describe("IdentityDeletionProcess", () => { await services1.transport.identityDeletionProcesses.cancelIdentityDeletionProcess(); await syncUntilHasEvent(services2, PeerDeletionCancelledEvent, (e) => e.data.id === relationshipId); + await services2.eventBus.waitForRunningEventHandlers(); const updatedRelationship = (await services2.transport.relationships.getRelationship({ id: relationshipId })).value; expect(updatedRelationship.peerDeletionInfo).toBeUndefined();