Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions test/Compliance.Tests/E2E/SplitHostTenantE2ETests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,17 @@ await TenantInvitationE2ETests.VerifyEmailAsync(factory, creator, creatorId, ema
await Task.Delay(250);
}
Assert.Equal(HttpStatusCode.OK, access);
using var tenantResponse = await creator.GetAsync($"/api/v1/tenants/{tenantId}");
Assert.Equal(HttpStatusCode.OK, tenantResponse.StatusCode);
var tenant = await tenantResponse.Content.ReadFromJsonAsync<Tenant>();
Tenant? tenant = null;
deadline = DateTimeOffset.UtcNow.AddSeconds(45);
while (DateTimeOffset.UtcNow < deadline)
{
using var tenantResponse = await creator.GetAsync($"/api/v1/tenants/{tenantId}");
Assert.Equal(HttpStatusCode.OK, tenantResponse.StatusCode);
tenant = await tenantResponse.Content.ReadFromJsonAsync<Tenant>();
if (tenant?.Status == "active")
break;
await Task.Delay(250);
}
Assert.Equal("active", tenant?.Status);
Assert.Null(tenant?.OperatorUserId);
using var outsiderDenied = await outsider.GetAsync(
Expand Down Expand Up @@ -790,6 +798,7 @@ await TenantInvitationE2ETests.VerifyEmailAsync(factory, administratorClient,
new { email_address = administratorEmail, token = invitationToken });
Assert.Equal(HttpStatusCode.NoContent, accepted.StatusCode);

deadline = DateTimeOffset.UtcNow.AddSeconds(45);
var access = HttpStatusCode.Forbidden;
while (DateTimeOffset.UtcNow < deadline)
{
Expand Down Expand Up @@ -825,6 +834,7 @@ await TenantInvitationE2ETests.VerifyEmailAsync(factory, staffClient, staffId, s
using var staffAccepted = await staffClient.PostAsJsonAsync(acceptancePath,
new { email_address = staffEmail, token = staffToken });
Assert.Equal(HttpStatusCode.NoContent, staffAccepted.StatusCode);
deadline = DateTimeOffset.UtcNow.AddSeconds(45);
Members? members = null;
while (DateTimeOffset.UtcNow < deadline)
{
Expand Down