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:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user