Harden the content contracts and enforce the slug rule

This commit is contained in:
tleininger committed 2026-09-24 12:08:56 +02:00
1 parent d06af2891a
commit 0f7e968c16
13 files changed
+157 -81

No files matched your search

+3 -1
View File
@@ -8,8 +8,10 @@ namespace Elternbeirat.Web.Tests;
/// </summary>
public class NavBuilderTests
{
// Id is required on the record but irrelevant to navigation, so a fixed
// placeholder keeps these cases focused on slug/location/order/title.
private static Page Page(string slug, string location, double order, string title) =>
new() { Slug = slug, Location = location, Order = order, Title = title };
new() { Id = "test", Slug = slug, Location = location, Order = order, Title = title };
[Fact]
public void Header_keeps_only_header_pages_ordered_by_order()
@@ -19,7 +19,6 @@ public sealed class PocketBaseClientTests(PocketBaseFixture pocketBase)
// Two seeded events, earliest start first.
events.Select(e => e.Title).ShouldBe(["Elternbeiratssitzung", "Herbstbasar"]);
events.ShouldAllBe(e => e.Public);
}
[Fact]
+1 -1
View File
@@ -335,6 +335,6 @@ public sealed class PocketBaseFixture : IAsyncLifetime
private sealed record AuthResponse
{
[System.Text.Json.Serialization.JsonPropertyName("token")]
public string Token { get; init; } = "";
public string Token { get; init; } = string.Empty;
}
}