We have important code that decides when and how to render row and column elements, which should be covered by tests but isn't.
To avoid later duplication of code by making BlockGrid.cshtml as small as possible. Upcoming work will require a TPR-specific version of BlockGrid.cshtml.
No change to behaviour.
Implementation
Move the logic that decides what to render out of the views and into a new BlockViewService, and add tests.
Make GovUkGridClassBuilder and GovUkFieldsetErrorFinder injectable rather than static classes so that they can be injected into BlockViewService. Make the static methods obsolete but retain them to make this a non-breaking change. Created #359 for later removal of these methods.
Added support for grid areas to our testing library.
Added support for non-nullable bool to our testing library, because .Value<bool>("field") was not working, only .Value<bool?>("field") worked.
Objectives of this PR
BlockGrid.cshtml
as small as possible. Upcoming work will require a TPR-specific version ofBlockGrid.cshtml
.Implementation
BlockViewService
, and add tests.GovUkGridClassBuilder
andGovUkFieldsetErrorFinder
injectable rather than static classes so that they can be injected intoBlockViewService
. Make the static methods obsolete but retain them to make this a non-breaking change. Created #359 for later removal of these methods..Value<bool>("field")
was not working, only.Value<bool?>("field")
worked.