Skip to content

Commit c3f5ac2

Browse files
authored
Flaky queued Notifications test (#357)
* fix: OwnSharedAttributeDeletedByOwnerNotificationItem not yet processed * fix: did not wait for running Message received event handler
1 parent 20398db commit c3f5ac2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/runtime/test/transport/messages.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
MessageReceivedEvent,
1212
MessageSentEvent,
1313
MessageWasReadAtChangedEvent,
14+
OwnSharedAttributeDeletedByOwnerEvent,
1415
OwnSharedAttributeSucceededEvent,
1516
PeerDeletionCancelledEvent,
1617
PeerToBeDeletedEvent,
@@ -448,6 +449,7 @@ describe("Postponed Notifications via Messages", () => {
448449

449450
const postponedMessages = await syncUntilHasMessages(client5.transport);
450451
expect(postponedMessages).toHaveLength(1);
452+
await client5.eventBus.waitForRunningEventHandlers();
451453
const postponedNotification = await client5.consumption.notifications.getNotification({ id: notificationId.toString() });
452454
expect(postponedNotification).toBeSuccessful();
453455
});
@@ -508,6 +510,8 @@ describe("Postponed Notifications via Messages", () => {
508510
const postponedDeletionNotification = await client5.consumption.notifications.getNotification({ id: notifyAboutDeletionResult.notificationId });
509511
expect(postponedDeletionNotification).toBeSuccessful();
510512

513+
await client5.eventBus.waitForEvent(OwnSharedAttributeDeletedByOwnerEvent);
514+
511515
const peerSharedIdentityAttribute = (await client5.consumption.attributes.getAttribute({ id: ownSharedIdentityAttribute.id })).value;
512516
assert(peerSharedIdentityAttribute.succeededBy);
513517
assert(peerSharedIdentityAttribute.deletionInfo?.deletionDate);

0 commit comments

Comments
 (0)