thepensionsregulator / govuk-frontend-aspnetcore-extensions

Adds client-side validation, additional components and editing in Umbraco to https://github.com/gunndabad/govuk-frontend-aspnetcore
MIT License
16 stars 1 forks source link

Some properties created with UmbracoBlockListFactory do not have their values overwritten by OverrideValue() whilst some do #347

Closed HarryAmmon closed 4 weeks ago

HarryAmmon commented 1 month ago

When calling .Content.OverrideValue(alias, value) on a Link property as part of a unit test, where the blocks have been created using UmbracoBlockListFactory, the URL (and other properties) are changed, this is the expected functionality.

When calling .Content.OverrideValue(alias, value) on text property of a GovukTypography block as part of a unit test, where the blocks have been created using UmbracoBlockListFactory, the original value is retained. This is inconsistent with the behaviour of overriding a Link

This means as part of a unit test, you can Assert that a link.Url has the correct, overriden value but on a text property you can only verify that .Content.OverrideValue(alias, value) was called with the correct parameters.

Anecdotally we have had trouble unit testing that legends, hints and text are overriden properly, this may explain why.

I will try to create a branch with tests that demonstrate this bug, I will update this issue if I do