1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-03 09:02:48 -05:00

PM-15084: Consistent notification center push type names.

Renamed PushType's `SyncNotification` to `Notification`, since the push type payload does not require, is not dependent on the sync mechanism.
This commit is contained in:
Maciej Zieniuk
2024-11-26 19:08:34 +00:00
parent a8efb45a63
commit 7b4122c837
9 changed files with 81 additions and 82 deletions

View File

@ -33,7 +33,7 @@ public class PushControllerTests
var exception = await Assert.ThrowsAsync<BadRequestException>(() =>
sutProvider.Sut.SendAsync(new PushSendRequestModel
{
Type = PushType.SyncNotification,
Type = PushType.Notification,
UserId = userId.ToString(),
OrganizationId = organizationId.ToString(),
InstallationId = installationId.ToString(),
@ -63,7 +63,7 @@ public class PushControllerTests
await sutProvider.Sut.SendAsync(new PushSendRequestModel
{
Type = PushType.SyncNotification,
Type = PushType.Notification,
UserId = null,
OrganizationId = null,
InstallationId = null,
@ -96,7 +96,7 @@ public class PushControllerTests
await sutProvider.Sut.SendAsync(new PushSendRequestModel
{
Type = PushType.SyncNotification,
Type = PushType.Notification,
UserId = userId.ToString(),
OrganizationId = haveOrganizationId ? Guid.NewGuid().ToString() : null,
InstallationId = null,
@ -107,7 +107,7 @@ public class PushControllerTests
});
await sutProvider.GetDependency<IPushNotificationService>().Received(1)
.SendPayloadToUserAsync(expectedUserId, PushType.SyncNotification, "test-payload", expectedIdentifier,
.SendPayloadToUserAsync(expectedUserId, PushType.Notification, "test-payload", expectedIdentifier,
expectedDeviceId, ClientType.All);
await sutProvider.GetDependency<IPushNotificationService>().Received(0)
.SendPayloadToOrganizationAsync(Arg.Any<string>(), Arg.Any<PushType>(), Arg.Any<object>(),
@ -132,7 +132,7 @@ public class PushControllerTests
await sutProvider.Sut.SendAsync(new PushSendRequestModel
{
Type = PushType.SyncNotification,
Type = PushType.Notification,
UserId = null,
OrganizationId = organizationId.ToString(),
InstallationId = null,
@ -143,7 +143,7 @@ public class PushControllerTests
});
await sutProvider.GetDependency<IPushNotificationService>().Received(1)
.SendPayloadToOrganizationAsync(expectedOrganizationId, PushType.SyncNotification, "test-payload",
.SendPayloadToOrganizationAsync(expectedOrganizationId, PushType.Notification, "test-payload",
expectedIdentifier, expectedDeviceId, ClientType.All);
await sutProvider.GetDependency<IPushNotificationService>().Received(0)
.SendPayloadToUserAsync(Arg.Any<string>(), Arg.Any<PushType>(), Arg.Any<object>(), Arg.Any<string>(),
@ -166,7 +166,7 @@ public class PushControllerTests
await sutProvider.Sut.SendAsync(new PushSendRequestModel
{
Type = PushType.SyncNotification,
Type = PushType.Notification,
UserId = null,
OrganizationId = null,
InstallationId = installationId.ToString(),
@ -177,7 +177,7 @@ public class PushControllerTests
});
await sutProvider.GetDependency<IPushNotificationService>().Received(1)
.SendPayloadToInstallationAsync(installationId.ToString(), PushType.SyncNotification, "test-payload",
.SendPayloadToInstallationAsync(installationId.ToString(), PushType.Notification, "test-payload",
expectedIdentifier, expectedDeviceId, ClientType.All);
await sutProvider.GetDependency<IPushNotificationService>().Received(0)
.SendPayloadToOrganizationAsync(Arg.Any<string>(), Arg.Any<PushType>(), Arg.Any<object>(),
@ -198,7 +198,7 @@ public class PushControllerTests
var exception = await Assert.ThrowsAsync<BadRequestException>(() =>
sutProvider.Sut.SendAsync(new PushSendRequestModel
{
Type = PushType.SyncNotification,
Type = PushType.Notification,
UserId = null,
OrganizationId = null,
InstallationId = Guid.NewGuid().ToString(),