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:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user