Offerings: OfferingBanner (planbare banner, GET /offerings/banner) en layout verwijderd (backend)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-12 10:47:44 +01:00
co-authored by Claude Sonnet 5.5
parent 6349d99f16
commit a2f4513205
24 changed files with 1005 additions and 161 deletions
@@ -3,6 +3,8 @@ using System.Text.Json;
using FluentAssertions;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Mvc.Testing;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
namespace SlpModularCms.Api.AndreaSlopFotografie.Tests;
@@ -38,6 +40,28 @@ public class HostPipelineTests : IClassFixture<AsfWebApplicationFactory>
modules.Should().NotContain("Master");
}
[Fact]
public async Task OfferingBanner_Is204_WhenNoneIsActive_AndOfferingsAreListed_OnAMigratedDatabase()
{
var client = _factory.CreateClient();
var banner = await client.GetAsync("/api/v1/offerings/banner");
banner.StatusCode.Should().Be(HttpStatusCode.NoContent);
(await client.GetAsync("/api/v1/offerings")).StatusCode.Should().Be(HttpStatusCode.OK);
(await client.GetAsync("/api/v1/offerings/banners")).StatusCode.Should().Be(HttpStatusCode.Unauthorized);
}
[Fact]
public void OfferingsMigrations_MatchTheModel()
{
_ = _factory.CreateClient(); // starts the host and migrates
using var scope = _factory.Services.CreateScope();
var db = scope.ServiceProvider.GetRequiredService<SlpModularCms.Modules.Offerings.Data.OfferingsDbContext>();
db.Database.HasPendingModelChanges().Should().BeFalse("every model change needs its migration and snapshot");
}
[Fact]
public async Task Health_IsReachable()
{