Closed NickColley closed 6 years ago
I've spiked this out: https://github.com/alphagov/govuk-frontend/compare/spike-expose-caller-in-review?expand=1
You can see in the current way our application is structure it results in duplication of logic in three places.
I'd recommend we refactor app.js to remove complex data 'setting' in templates, and instead keep data at the top level passed down to templates.
Then share the rendering of components between the HTML Code examples, the iFrame preview and the test render helper.
As long as we have test coverage, I don't think we need to have examples in the review app, as neither the generated HTML nor the styling should differ from any other example.
So I'd suggest scoping this to just making sure we have tests that cover the {% call %}
use case.
This has been implemented
Some of our components allow nesting using https://mozilla.github.io/nunjucks/templating.html#call.
We currently can't show this in the guide or tests, so this functionality could break.
For example https://github.com/alphagov/govuk-frontend/pull/509 we do not have coverage for 'caller'
We would need to