mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 07:36:14 -05:00
PM-10564: CreateNotificationStatusCommand sends wrong create push event type.
Any update to the Notification from user perspective should be treated as update. That includes NotificationStatus, which when created would be displayed as update to the notification. Hence, push notification should be update type.
This commit is contained in:
@ -48,7 +48,7 @@ public class CreateNotificationStatusCommand : ICreateNotificationStatusCommand
|
||||
|
||||
var newNotificationStatus = await _notificationStatusRepository.CreateAsync(notificationStatus);
|
||||
|
||||
await _pushNotificationService.PushSyncNotificationCreateAsync(notification, newNotificationStatus);
|
||||
await _pushNotificationService.PushSyncNotificationUpdateAsync(notification, newNotificationStatus);
|
||||
|
||||
return newNotificationStatus;
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ public class CreateNotificationStatusCommandTest
|
||||
await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.CreateAsync(notificationStatus));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(0)
|
||||
.PushSyncNotificationCreateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
.PushSyncNotificationUpdateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@ -67,7 +67,7 @@ public class CreateNotificationStatusCommandTest
|
||||
await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.CreateAsync(notificationStatus));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(0)
|
||||
.PushSyncNotificationCreateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
.PushSyncNotificationUpdateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@ -81,7 +81,7 @@ public class CreateNotificationStatusCommandTest
|
||||
await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.CreateAsync(notificationStatus));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(0)
|
||||
.PushSyncNotificationCreateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
.PushSyncNotificationUpdateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@ -97,6 +97,6 @@ public class CreateNotificationStatusCommandTest
|
||||
Assert.Equal(notificationStatus, newNotificationStatus);
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(1)
|
||||
.PushSyncNotificationCreateAsync(notification, notificationStatus);
|
||||
.PushSyncNotificationUpdateAsync(notification, notificationStatus);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user