Loosen the RTEValue datacontract to improve migrations (#18349)

This commit is contained in:
Sven Geusens
2025-02-17 15:27:22 +01:00
committed by GitHub
parent 8bbb12da5a
commit d87a84be14
2 changed files with 17 additions and 1 deletions

View File

@@ -94,6 +94,22 @@ public class RichTextPropertyEditorHelperTests
});
}
[Test]
public void Can_Parse_JObject_With_Missing_Blocks()
{
var input = JsonNode.Parse(""""
{
"markup": "<h2>Vælg et af vores mest populære produkter</h2>"
}
"""");
var result = RichTextPropertyEditorHelper.TryParseRichTextEditorValue(input, JsonSerializer(), Logger(), out RichTextEditorValue? value);
Assert.IsTrue(result);
Assert.IsNotNull(value);
Assert.AreEqual("<h2>Vælg et af vores mest populære produkter</h2>", value.Markup);
Assert.IsNull(value.Blocks);
}
[Test]
public void Can_Parse_Blocks_With_Both_Content_And_Settings()
{