Add home hero with intro and buttons from the body, next-event card and page tiles

This commit is contained in:
tleininger committed 2026-10-01 14:05:25 +02:00
1 parent b737f57ef7
commit e51afeb34b
23 files changed
+1262 -65

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
using Elternbeirat.Web.Features.Home;
using Elternbeirat.Web.Shared;
namespace Elternbeirat.Web.Tests;
/// <summary>
/// Unit tests for the slug-to-icon mapping of the home page tiles. Pure logic, no
/// PocketBase needed.
/// </summary>
public class TileIconsTests
{
[Theory]
[InlineData("board", "users")]
[InlineData("faqs", "help-circle")]
[InlineData("events", "calendar")]
public void Known_slug_gets_its_icon(string slug, string icon) =>
TileIcons.For(slug).ShouldBe(icon);
[Theory]
[InlineData("schulweg")] // a page an editor just created
[InlineData("Board")] // slugs are lowercase; anything else is unknown
[InlineData("")]
public void Unknown_slug_gets_the_default_icon(string slug) =>
TileIcons.For(slug).ShouldBe(TileIcons.Default);
[Theory]
[InlineData("board")]
[InlineData("patrons")]
[InlineData("faqs")]
[InlineData("downloads")]
[InlineData("posts")]
[InlineData("events")]
[InlineData("contact")]
[InlineData("unbekannt")] // the default
public void Every_icon_exists_in_the_icon_set(string slug) =>
IconSet.Find(TileIcons.For(slug)).ShouldNotBeNull(); // a typo would render no icon at all
}