Serve FAQs from PocketBase on a grouped /faqs page

This commit is contained in:
tleininger committed 2026-09-23 14:15:16 +02:00
1 parent 4136af6417
commit 6b5d9dda55
7 files changed
+127 -7

No files matched your search

+3 -1
View File
@@ -260,10 +260,12 @@ public sealed class PocketBaseFixture : IAsyncLifetime
title = "Förderverein", body = "# Förderverein", location = "header",
order = 3, slug = "patrons", embed = Array.Empty<string>(), @public = true,
});
// Nav placeholder for the FAQ list (route /faqs is served by FaqList,
// which shadows this page). Slug matches production's "faqs" nav entry.
await CreateRecordAsync(http, "pages", new
{
title = "FAQ", body = "# Häufige Fragen", location = "header",
order = 4, slug = "faq", embed = Array.Empty<string>(), @public = true,
order = 4, slug = "faqs", embed = Array.Empty<string>(), @public = true,
});
await CreateRecordAsync(http, "pages", new
{
+16 -1
View File
@@ -48,7 +48,7 @@ public sealed class RouteSmokeTests : IDisposable
"/",
"/board",
"/patrons",
"/faq",
"/faqs",
"/faq-mensa",
"/downloads",
"/contact",
@@ -83,4 +83,19 @@ public sealed class RouteSmokeTests : IDisposable
response.StatusCode.ShouldBe(HttpStatusCode.NotFound);
}
[Fact]
public async Task Faqs_route_renders_the_grouped_list()
{
// /faqs is a literal route (FaqList) that must win over the /{Slug}
// catch-all content page. Assert it shows the FAQ list, grouped by topic
// from the seeded questions, not a content page body.
var client = _factory.CreateClient();
var html = await client.GetStringAsync(new Uri("/faqs", UriKind.Relative));
html.ShouldContain("Häufige Fragen");
html.ShouldContain("Wann gibt es Mittagessen?");
html.ShouldContain("Mensa und Mittagessen"); // German topic heading
}
}