Complete phase 39 school owners with owner-scoped API, menu, and tests.

Drop golden save load tests in favor of incompatible-save behavior; dress legacy people files on reload; fix AppHost isolation for multi-user socket and save cleanup.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Leonid Pershin
2026-08-20 09:44:08 +03:00
co-authored by Cursor
parent 4b236a7916
commit cc18429108
15 changed files with 371 additions and 341 deletions
@@ -26,7 +26,16 @@ public class ServiceabilityTests(AppHostFixture fixture)
using var reload = await client.PostAsync("/api/dev/reload-schools", content: null, TestContext.Current.CancellationToken);
reload.EnsureSuccessStatusCode();
Assert.Empty((await SchoolApiTests.GetSchoolsAsync(client)).Schools);
var state = await SchoolApiTests.GetSchoolsAsync(client);
Assert.Empty(state.Schools);
var broken = Assert.Single(state.Others);
Assert.Equal(1, broken.Id);
using var people = await client.GetAsync(
$"/api/schools/{broken.Id}/people?pageSize=1",
TestContext.Current.CancellationToken);
Assert.Equal(HttpStatusCode.NotFound, people.StatusCode);
Assert.Equal(before, File.ReadAllBytes(path));
}
finally
@@ -54,7 +63,16 @@ public class ServiceabilityTests(AppHostFixture fixture)
using var reload = await client.PostAsync("/api/dev/reload-schools", content: null, TestContext.Current.CancellationToken);
reload.EnsureSuccessStatusCode();
Assert.Empty((await SchoolApiTests.GetSchoolsAsync(client)).Schools);
var state = await SchoolApiTests.GetSchoolsAsync(client);
Assert.Empty(state.Schools);
var broken = Assert.Single(state.Others);
Assert.Equal(1, broken.Id);
using var people = await client.GetAsync(
$"/api/schools/{broken.Id}/people?pageSize=1",
TestContext.Current.CancellationToken);
Assert.Equal(HttpStatusCode.NotFound, people.StatusCode);
Assert.Equal(before, File.ReadAllBytes(path));
}
finally
@@ -65,29 +83,6 @@ public class ServiceabilityTests(AppHostFixture fixture)
}
}
[Fact]
public async Task CurrentFormatSave_LoadsAsBefore()
{
using var client = fixture.App.CreateHttpClient("server");
await SchoolApiTests.ResetAsync(client);
var directory = await SavesDirectoryAsync(client);
try
{
InstallGolden(directory, "current");
using var reload = await client.PostAsync("/api/dev/reload-schools", content: null, TestContext.Current.CancellationToken);
reload.EnsureSuccessStatusCode();
var school = Assert.Single((await SchoolApiTests.GetSchoolsAsync(client)).Schools);
Assert.Equal(1, school.Id);
Assert.Equal("Золотая", school.Name);
}
finally
{
await SchoolApiTests.ResetAsync(client);
}
}
[Fact]
public async Task Dump_ReturnsPeopleNodesAndTimetable()
{