Serve pages and home from PocketBase, drop the file-based content layer
This commit is contained in:
1 parent
da87716d97
commit
4136af6417
15 files changed
+117
-285
No files matched your search
@@ -70,9 +70,10 @@ public sealed class PocketBaseClientTests(PocketBaseFixture pocketBase)
|
||||
|
||||
var pages = await client.GetPagesAsync();
|
||||
|
||||
// Three pages seeded, one with public=false; the draft must be filtered out.
|
||||
pages.Select(p => p.Slug).ShouldBe(["home", "contact"]);
|
||||
// The draft (public=false) must be filtered out, the public ones present.
|
||||
pages.ShouldNotContain(p => p.Slug == "draft");
|
||||
pages.ShouldContain(p => p.Slug == "home");
|
||||
pages.ShouldContain(p => p.Slug == "contact");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
||||
@@ -191,7 +191,7 @@ public sealed class PocketBaseFixture : IAsyncLifetime
|
||||
await CreateCollectionAsync(http, "pages", new object[]
|
||||
{
|
||||
new { name = "title", type = "text", required = true },
|
||||
new { name = "body", type = "editor" },
|
||||
new { name = "body", type = "text" },
|
||||
new { name = "location", type = "select", maxSelect = 1, values = new[] { "header", "footer" } },
|
||||
new { name = "order", type = "number" },
|
||||
new { name = "slug", type = "text", required = true },
|
||||
@@ -203,7 +203,7 @@ public sealed class PocketBaseFixture : IAsyncLifetime
|
||||
{
|
||||
new { name = "date", type = "date" },
|
||||
new { name = "title", type = "text", required = true },
|
||||
new { name = "body", type = "editor" },
|
||||
new { name = "body", type = "text" },
|
||||
new { name = "slug", type = "text", required = true },
|
||||
new { name = "public", type = "bool" },
|
||||
});
|
||||
@@ -221,7 +221,7 @@ public sealed class PocketBaseFixture : IAsyncLifetime
|
||||
await CreateCollectionAsync(http, "faqs", new object[]
|
||||
{
|
||||
new { name = "question", type = "text", required = true },
|
||||
new { name = "answer", type = "editor" },
|
||||
new { name = "answer", type = "text" },
|
||||
new { name = "topic", type = "select", maxSelect = 1, values = new[] { "mensa", "schliessfach", "elterneuro", "elternarbeit" } },
|
||||
new { name = "public", type = "bool" },
|
||||
});
|
||||
@@ -242,17 +242,54 @@ public sealed class PocketBaseFixture : IAsyncLifetime
|
||||
|
||||
private static async Task SeedRecordsAsync(HttpClient http)
|
||||
{
|
||||
// Pages: one header page, one footer page. Both public.
|
||||
// Pages that the route smoke tests reach through the navigation, the
|
||||
// footer or the FAQ hub. Header pages carry a location+order; the FAQ
|
||||
// sub-pages are plain content pages without a menu slot. All public.
|
||||
await CreateRecordAsync(http, "pages", new
|
||||
{
|
||||
title = "Startseite", body = "# Willkommen", location = "header",
|
||||
order = 1, slug = "home", embed = new[] { "posts", "events" }, @public = true,
|
||||
});
|
||||
await CreateRecordAsync(http, "pages", new
|
||||
{
|
||||
title = "Vorstandsteam", body = "# Vorstand", location = "header",
|
||||
order = 2, slug = "board", embed = Array.Empty<string>(), @public = true,
|
||||
});
|
||||
await CreateRecordAsync(http, "pages", new
|
||||
{
|
||||
title = "Förderverein", body = "# Förderverein", location = "header",
|
||||
order = 3, slug = "patrons", embed = Array.Empty<string>(), @public = true,
|
||||
});
|
||||
await CreateRecordAsync(http, "pages", new
|
||||
{
|
||||
title = "FAQ", body = "# Häufige Fragen", location = "header",
|
||||
order = 4, slug = "faq", embed = Array.Empty<string>(), @public = true,
|
||||
});
|
||||
await CreateRecordAsync(http, "pages", new
|
||||
{
|
||||
title = "Downloads", body = "# Downloads", location = "header",
|
||||
order = 5, slug = "downloads", embed = Array.Empty<string>(), @public = true,
|
||||
});
|
||||
await CreateRecordAsync(http, "pages", new
|
||||
{
|
||||
title = "FAQ Mensa", body = "# Mensa", location = "",
|
||||
order = 0, slug = "faq-mensa", embed = Array.Empty<string>(), @public = true,
|
||||
});
|
||||
await CreateRecordAsync(http, "pages", new
|
||||
{
|
||||
title = "Kontakt", body = "Mail an uns", location = "footer",
|
||||
order = 1, slug = "contact", embed = Array.Empty<string>(), @public = true,
|
||||
});
|
||||
await CreateRecordAsync(http, "pages", new
|
||||
{
|
||||
title = "Impressum", body = "# Impressum", location = "footer",
|
||||
order = 2, slug = "imprint", embed = Array.Empty<string>(), @public = true,
|
||||
});
|
||||
await CreateRecordAsync(http, "pages", new
|
||||
{
|
||||
title = "Datenschutz", body = "# Datenschutz", location = "footer",
|
||||
order = 3, slug = "privacy", embed = Array.Empty<string>(), @public = true,
|
||||
});
|
||||
// A draft page that must never appear (public=false).
|
||||
await CreateRecordAsync(http, "pages", new
|
||||
{
|
||||
|
||||
@@ -46,17 +46,14 @@ public sealed class RouteSmokeTests : IDisposable
|
||||
public static TheoryData<string> KnownRoutes =>
|
||||
[
|
||||
"/",
|
||||
"/vorstandsteam",
|
||||
"/foerderverein",
|
||||
"/board",
|
||||
"/patrons",
|
||||
"/faq",
|
||||
"/faq-mensa",
|
||||
"/faq-schliessfach",
|
||||
"/faq-elterneuro",
|
||||
"/faq-elternarbeit",
|
||||
"/downloads",
|
||||
"/kontakt",
|
||||
"/impressum",
|
||||
"/datenschutz",
|
||||
"/contact",
|
||||
"/imprint",
|
||||
"/privacy",
|
||||
"/posts",
|
||||
"/posts/new-board",
|
||||
"/posts/new-hall",
|
||||
|
||||
Reference in new issue
Block a user