Offerings: beschrijving en prijsnotitie optioneel (API, admin, index-markers, OpenAPI)
Ontbrekend/null/leeg wordt als lege string opgeslagen en teruggegeven; JSON-LD laat description weg en de HTML-markers renderen geen lege <p>. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -71,6 +71,28 @@ public class OfferingsIndexMarkersTests
|
||||
"<p>Beschrijving</p><p>€ 300 eenmalig</p></li></ul></section>");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WithoutDescription_NothingEmptyIsRendered()
|
||||
{
|
||||
var empty = Dto("Zwangerschap", price: "€ 175", note: "") with { Description = "" };
|
||||
|
||||
var html = OfferingsIndexMarkers.Html([empty]);
|
||||
html.Should().Be("<section id=\"packages-static\" aria-label=\"Pakketten\"><ul><li><h3>Zwangerschap</h3><p>€ 175</p></li></ul></section>");
|
||||
html.Should().NotContain("<p></p>");
|
||||
|
||||
var json = OfferingsIndexMarkers.JsonLd([empty], "https://x.nl");
|
||||
json.Should().NotContain("\"description\"");
|
||||
json.Should().Contain("\"price\":\"175\"");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void WithoutDescriptionAndPrice_TheListItemHasOnlyATitle()
|
||||
{
|
||||
var bare = Dto("Maatwerk", price: "", note: "") with { Description = "" };
|
||||
|
||||
OfferingsIndexMarkers.Html([bare]).Should().Contain("<li><h3>Maatwerk</h3></li>");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task WithoutOfferings_BothMarkersAreEmpty()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user