merge: web admin after the visual, accessibility and RTL review (dark theme, plurals, audit filters)

This commit is contained in:
Claude committed 2026-10-06 21:18:24 +00:00
commit 66374d762c
22 files changed
+1192 -437

No files matched your search

@@ -60,6 +60,31 @@ public sealed class UserTests(TestContext context)
using (var delete = await admin.DeleteAsync($"/api/v1/users/{self.Id}")) await delete.ExpectErrorAsync(HttpStatusCode.Conflict, "self");
}
[Test]
public async Task ResettingOnesOwnPasswordIsRefusedAndTheSessionSurvives()
{
await using var server = await TestServer.StartAsync(context);
var admin = await server.AdminAsync();
using var me = await admin.GetAsync("/api/v1/auth/me");
var self = await me.ReadAsync(ProtocolJson.Default.UserDto);
using (var reset = await admin.PostAsJsonAsync($"/api/v1/users/{self.Id}/reset-password", new ResetPasswordRequest(null), ProtocolJson.Default.ResetPasswordRequest))
await reset.ExpectErrorAsync(HttpStatusCode.Conflict, "self");
using var still = await admin.GetAsync("/api/v1/auth/me");
Assert.False((await still.ReadAsync(ProtocolJson.Default.UserDto)).MustChangePassword);
}
[Test]
public async Task TheSignInLogListsFailedAttemptsToo()
{
await using var server = await TestServer.StartAsync(context);
var admin = await server.AdminAsync();
using (var wrong = await server.Client.PostAsJsonAsync("/api/v1/auth/login", new LoginRequest("admin", "not-the-password", "tests"), ProtocolJson.Default.LoginRequest))
Assert.Equal(HttpStatusCode.Unauthorized, wrong.StatusCode);
using var log = await admin.GetAsync("/api/v1/audit?action=login,login_failed");
var actions = (await log.ReadAsync(ProtocolJson.Default.PageAuditEntryDto)).Items.Select(e => e.Action).ToHashSet();
Assert.True(actions.SetEquals(["login", "login_failed"]), string.Join(",", actions));
}
[Test]
public async Task DeletingAUserHandsTheirSequencesToTheAdmin()
{