H4: hero in de eerste HTML (regio, preload), gedeeld datablok met contributors (Offerings byte-identiek), ASF golden files, volledige pijplijntest
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,9 @@ public class OfferingsHtmlTransformTests
|
||||
|
||||
private OfferingsHtmlTransform Sut() => new(_offerings, _banners);
|
||||
|
||||
// The data block is composed by the Core transform from the contributors of the Offerings module (same output as before).
|
||||
private CmsDataBlockTransform DataBlock() => new([new OfferingsDataContributor(_offerings), new BannersDataContributor(_banners)]);
|
||||
|
||||
private static OfferingDto Offering(string slug, string title, string price, int order = 0, bool featured = false) => new(
|
||||
Guid.NewGuid().ToString(), slug, title, "Beschrijving", price, "eenmalig", ["1 uur fotografie", "Online galerij"], "Boek", featured, order);
|
||||
|
||||
@@ -92,7 +95,7 @@ public class OfferingsHtmlTransformTests
|
||||
Banner("top", top);
|
||||
Banner("bottom", null);
|
||||
|
||||
var html = await Sut().ApplyAsync("<head><!--CMS:DATA--><script type=\"application/json\" id=\"cms-data\">{\"baked\":true}</script></head>", Context, default);
|
||||
var html = await DataBlock().ApplyAsync("<head><!--CMS:DATA--><script type=\"application/json\" id=\"cms-data\">{\"baked\":true}</script></head>", Context, default);
|
||||
|
||||
html.Should().StartWith("<head><script type=\"application/json\" id=\"cms-data\">").And.EndWith("</script></head>");
|
||||
var json = html["<head><script type=\"application/json\" id=\"cms-data\">".Length..^"</script></head>".Length];
|
||||
@@ -114,7 +117,7 @@ public class OfferingsHtmlTransformTests
|
||||
Banner("top", null);
|
||||
Banner("bottom", null);
|
||||
|
||||
var html = await Sut().ApplyAsync("<!--CMS:DATA-->", Context, default);
|
||||
var html = await DataBlock().ApplyAsync("<!--CMS:DATA-->", Context, default);
|
||||
|
||||
var inner = html["<script type=\"application/json\" id=\"cms-data\">".Length..^"</script>".Length];
|
||||
inner.Should().NotContain("<").And.NotContain(">").And.NotContain("&").And.NotContain("\u2028");
|
||||
|
||||
Reference in New Issue
Block a user