1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 16:12:49 -05:00

PM-10564: Sync notification push type separation for notification updates

Sync notification push type is now used for both Notification create and update.
Renamed the event types to specifically mention the purpose of status for notification status updates.
This commit is contained in:
Maciej Zieniuk
2024-11-25 20:45:41 +00:00
parent 1285a7e994
commit fcf346985f
22 changed files with 221 additions and 184 deletions

View File

@ -53,7 +53,10 @@ public class CreateNotificationStatusCommandTest
await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.CreateAsync(notificationStatus));
await sutProvider.GetDependency<IPushNotificationService>()
.Received(0)
.PushSyncNotificationUpdateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
.PushSyncNotificationStatusAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus>());
await sutProvider.GetDependency<IPushNotificationService>()
.Received(0)
.PushSyncNotificationAsync(Arg.Any<Notification>());
}
[Theory]
@ -67,7 +70,10 @@ public class CreateNotificationStatusCommandTest
await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.CreateAsync(notificationStatus));
await sutProvider.GetDependency<IPushNotificationService>()
.Received(0)
.PushSyncNotificationUpdateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
.PushSyncNotificationStatusAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus>());
await sutProvider.GetDependency<IPushNotificationService>()
.Received(0)
.PushSyncNotificationAsync(Arg.Any<Notification>());
}
[Theory]
@ -81,7 +87,10 @@ public class CreateNotificationStatusCommandTest
await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.CreateAsync(notificationStatus));
await sutProvider.GetDependency<IPushNotificationService>()
.Received(0)
.PushSyncNotificationUpdateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
.PushSyncNotificationStatusAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus>());
await sutProvider.GetDependency<IPushNotificationService>()
.Received(0)
.PushSyncNotificationAsync(Arg.Any<Notification>());
}
[Theory]
@ -97,6 +106,9 @@ public class CreateNotificationStatusCommandTest
Assert.Equal(notificationStatus, newNotificationStatus);
await sutProvider.GetDependency<IPushNotificationService>()
.Received(1)
.PushSyncNotificationUpdateAsync(notification, notificationStatus);
.PushSyncNotificationStatusAsync(notification, notificationStatus);
await sutProvider.GetDependency<IPushNotificationService>()
.Received(0)
.PushSyncNotificationAsync(Arg.Any<Notification>());
}
}