Merge main into phase/39-school-owners.

Keep school owners and phase 41 opinions/portraits together; ResetAsync wipes all saves so shared AppHost tests stay isolated.
This commit is contained in:
Leonid Pershin
2026-08-20 08:36:13 +03:00
44 changed files with 1388 additions and 85 deletions
+11 -21
View File
@@ -592,26 +592,7 @@ public class SchoolApiTests(AppHostFixture fixture)
internal static async Task ResetAsync(HttpClient client)
{
await LoginAsync(client);
var state = await GetSchoolsAsync(client);
foreach (var school in state.Schools)
{
using var response = await client.DeleteAsync($"/api/schools/{school.Id}", TestContext.Current.CancellationToken);
response.EnsureSuccessStatusCode();
}
foreach (var school in state.Others)
{
using var response = await client.DeleteAsync($"/api/schools/{school.Id}", TestContext.Current.CancellationToken);
if (response.StatusCode == HttpStatusCode.Forbidden)
{
continue;
}
response.EnsureSuccessStatusCode();
}
await WipeAllSavesAsync(client);
}
internal static async Task WipeAllSavesAsync(HttpClient client)
@@ -731,7 +712,16 @@ public class SchoolApiTests(AppHostFixture fixture)
return payload.Path;
}
private sealed record SchoolSaveFile(string? CountryId, string? ClimatePresetId, string? NativeLanguage, string? Owner);
private sealed record SchoolSaveFile(
string? CountryId,
string? ClimatePresetId,
string? NativeLanguage,
string? Owner,
SwarmUiSaveFile? PortraitSettings);
private sealed record SwarmUiSaveFile(string? ActivePresetId, IReadOnlyList<SwarmUiPresetSave>? Presets);
private sealed record SwarmUiPresetSave(string? Id, string? Model);
internal static readonly object SimpleCustomMap = new
{