mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 16:12:49 -05:00
PM-10564: Wrong push notification received when notification updated.
This commit is contained in:
@ -66,7 +66,7 @@ public class MarkNotificationDeletedCommandTest
|
||||
await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.MarkDeletedAsync(notificationId));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(0)
|
||||
.PushSyncNotificationCreateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
.PushSyncNotificationUpdateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@ -80,7 +80,7 @@ public class MarkNotificationDeletedCommandTest
|
||||
await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.MarkDeletedAsync(notificationId));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(0)
|
||||
.PushSyncNotificationCreateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
.PushSyncNotificationUpdateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@ -95,7 +95,7 @@ public class MarkNotificationDeletedCommandTest
|
||||
await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.MarkDeletedAsync(notificationId));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(0)
|
||||
.PushSyncNotificationCreateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
.PushSyncNotificationUpdateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@ -110,7 +110,7 @@ public class MarkNotificationDeletedCommandTest
|
||||
await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.MarkDeletedAsync(notificationId));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(0)
|
||||
.PushSyncNotificationCreateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
.PushSyncNotificationUpdateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@ -125,7 +125,7 @@ public class MarkNotificationDeletedCommandTest
|
||||
await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.MarkDeletedAsync(notificationId));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(0)
|
||||
.PushSyncNotificationCreateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
.PushSyncNotificationUpdateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@ -149,7 +149,7 @@ public class MarkNotificationDeletedCommandTest
|
||||
.CreateAsync(Arg.Do<NotificationStatus>(ns => AssertNotificationStatus(expectedNotificationStatus, ns)));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(1)
|
||||
.PushSyncNotificationCreateAsync(notification,
|
||||
.PushSyncNotificationUpdateAsync(notification,
|
||||
Arg.Do<NotificationStatus>(ns => AssertNotificationStatus(expectedNotificationStatus, ns)));
|
||||
}
|
||||
|
||||
@ -167,7 +167,7 @@ public class MarkNotificationDeletedCommandTest
|
||||
.UpdateAsync(Arg.Do<NotificationStatus>(ns => AssertNotificationStatus(notificationStatus, ns)));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(1)
|
||||
.PushSyncNotificationCreateAsync(notification,
|
||||
.PushSyncNotificationUpdateAsync(notification,
|
||||
Arg.Do<NotificationStatus?>(ns => AssertNotificationStatus(notificationStatus, ns)));
|
||||
}
|
||||
|
||||
|
@ -66,7 +66,7 @@ public class MarkNotificationReadCommandTest
|
||||
await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.MarkReadAsync(notificationId));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(0)
|
||||
.PushSyncNotificationCreateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
.PushSyncNotificationUpdateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@ -80,7 +80,7 @@ public class MarkNotificationReadCommandTest
|
||||
await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.MarkReadAsync(notificationId));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(0)
|
||||
.PushSyncNotificationCreateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
.PushSyncNotificationUpdateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@ -95,7 +95,7 @@ public class MarkNotificationReadCommandTest
|
||||
await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.MarkReadAsync(notificationId));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(0)
|
||||
.PushSyncNotificationCreateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
.PushSyncNotificationUpdateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@ -110,7 +110,7 @@ public class MarkNotificationReadCommandTest
|
||||
await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.MarkReadAsync(notificationId));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(0)
|
||||
.PushSyncNotificationCreateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
.PushSyncNotificationUpdateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@ -125,7 +125,7 @@ public class MarkNotificationReadCommandTest
|
||||
await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.MarkReadAsync(notificationId));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(0)
|
||||
.PushSyncNotificationCreateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
.PushSyncNotificationUpdateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@ -149,7 +149,7 @@ public class MarkNotificationReadCommandTest
|
||||
.CreateAsync(Arg.Do<NotificationStatus>(ns => AssertNotificationStatus(expectedNotificationStatus, ns)));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(1)
|
||||
.PushSyncNotificationCreateAsync(notification,
|
||||
.PushSyncNotificationUpdateAsync(notification,
|
||||
Arg.Do<NotificationStatus>(ns => AssertNotificationStatus(expectedNotificationStatus, ns)));
|
||||
}
|
||||
|
||||
@ -167,7 +167,7 @@ public class MarkNotificationReadCommandTest
|
||||
.UpdateAsync(Arg.Do<NotificationStatus>(ns => AssertNotificationStatus(notificationStatus, ns)));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(1)
|
||||
.PushSyncNotificationCreateAsync(notification,
|
||||
.PushSyncNotificationUpdateAsync(notification,
|
||||
Arg.Do<NotificationStatus?>(ns => AssertNotificationStatus(notificationStatus, ns)));
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ public class UpdateNotificationCommandTest
|
||||
await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.UpdateAsync(notification));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(0)
|
||||
.PushSyncNotificationCreateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
.PushSyncNotificationUpdateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@ -62,7 +62,7 @@ public class UpdateNotificationCommandTest
|
||||
await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.UpdateAsync(notification));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(0)
|
||||
.PushSyncNotificationCreateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
.PushSyncNotificationUpdateAsync(Arg.Any<Notification>(), Arg.Any<NotificationStatus?>());
|
||||
}
|
||||
|
||||
[Theory]
|
||||
@ -100,6 +100,6 @@ public class UpdateNotificationCommandTest
|
||||
DateTime.UtcNow - n.RevisionDate < TimeSpan.FromMinutes(1)));
|
||||
await sutProvider.GetDependency<IPushNotificationService>()
|
||||
.Received(1)
|
||||
.PushSyncNotificationCreateAsync(notification, null);
|
||||
.PushSyncNotificationUpdateAsync(notification, null);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user