From 01c814595e572911574066802b661c83b116a865 Mon Sep 17 00:00:00 2001 From: Maciej Zieniuk Date: Thu, 21 Nov 2024 22:26:12 +0000 Subject: [PATCH] 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. --- .../Commands/CreateNotificationStatusCommand.cs | 2 +- .../Commands/CreateNotificationStatusCommandTest.cs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Core/NotificationCenter/Commands/CreateNotificationStatusCommand.cs b/src/Core/NotificationCenter/Commands/CreateNotificationStatusCommand.cs index 3c1b0fcf00..8e54a55c5c 100644 --- a/src/Core/NotificationCenter/Commands/CreateNotificationStatusCommand.cs +++ b/src/Core/NotificationCenter/Commands/CreateNotificationStatusCommand.cs @@ -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; } diff --git a/test/Core.Test/NotificationCenter/Commands/CreateNotificationStatusCommandTest.cs b/test/Core.Test/NotificationCenter/Commands/CreateNotificationStatusCommandTest.cs index efe9d4236c..80ad31ead2 100644 --- a/test/Core.Test/NotificationCenter/Commands/CreateNotificationStatusCommandTest.cs +++ b/test/Core.Test/NotificationCenter/Commands/CreateNotificationStatusCommandTest.cs @@ -53,7 +53,7 @@ public class CreateNotificationStatusCommandTest await Assert.ThrowsAsync(() => sutProvider.Sut.CreateAsync(notificationStatus)); await sutProvider.GetDependency() .Received(0) - .PushSyncNotificationCreateAsync(Arg.Any(), Arg.Any()); + .PushSyncNotificationUpdateAsync(Arg.Any(), Arg.Any()); } [Theory] @@ -67,7 +67,7 @@ public class CreateNotificationStatusCommandTest await Assert.ThrowsAsync(() => sutProvider.Sut.CreateAsync(notificationStatus)); await sutProvider.GetDependency() .Received(0) - .PushSyncNotificationCreateAsync(Arg.Any(), Arg.Any()); + .PushSyncNotificationUpdateAsync(Arg.Any(), Arg.Any()); } [Theory] @@ -81,7 +81,7 @@ public class CreateNotificationStatusCommandTest await Assert.ThrowsAsync(() => sutProvider.Sut.CreateAsync(notificationStatus)); await sutProvider.GetDependency() .Received(0) - .PushSyncNotificationCreateAsync(Arg.Any(), Arg.Any()); + .PushSyncNotificationUpdateAsync(Arg.Any(), Arg.Any()); } [Theory] @@ -97,6 +97,6 @@ public class CreateNotificationStatusCommandTest Assert.Equal(notificationStatus, newNotificationStatus); await sutProvider.GetDependency() .Received(1) - .PushSyncNotificationCreateAsync(notification, notificationStatus); + .PushSyncNotificationUpdateAsync(notification, notificationStatus); } }