Uitnodigingen: geldigheid instelbaar (standaard 24 uur) en verlopen uitnodigingen zichtbaar en verwijderbaar
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -125,6 +125,28 @@ public class UsersControllerTests : IDisposable
|
||||
list.Should().Contain(u => u.Email == "pending@test.com" && u.InvitationPending);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task GetUsers_ShowsExpiredInvitations_WithoutALink_SoTheyCanBeRemoved()
|
||||
{
|
||||
_invitationService.GetPendingInvitationByEmailAsync(Arg.Any<string>()).Returns((false, null));
|
||||
_invitationService.GetAllPendingInvitationsAsync().Returns([
|
||||
new PendingInvitationInfo(Guid.NewGuid(), "late@test.com", "User", "tok", DateTimeOffset.UtcNow.AddDays(-2), IsExpired: true),
|
||||
new PendingInvitationInfo(Guid.NewGuid(), "fresh@test.com", "User", "tok2", DateTimeOffset.UtcNow)
|
||||
]);
|
||||
|
||||
var result = await CreateController().GetUsers();
|
||||
|
||||
var list = result.Should().BeOfType<OkObjectResult>().Subject.Value
|
||||
.Should().BeAssignableTo<IEnumerable<UserDto>>().Subject.ToList();
|
||||
var late = list.Single(u => u.Email == "late@test.com");
|
||||
late.InvitationPending.Should().BeTrue();
|
||||
late.InvitationExpired.Should().BeTrue();
|
||||
late.InviteLink.Should().BeNull();
|
||||
var fresh = list.Single(u => u.Email == "fresh@test.com");
|
||||
fresh.InvitationExpired.Should().BeFalse();
|
||||
fresh.InviteLink.Should().Contain("token=tok2");
|
||||
}
|
||||
|
||||
// --- UpdateProfile ---
|
||||
|
||||
[Fact]
|
||||
|
||||
Reference in New Issue
Block a user