Closed matthew-shaw closed 1 year ago
Thanks so much for taking the time to look at this @leohemsted, really appreciate your contributions. Running the tests with a --exclude tabs
flag results in 568 passing tests now. I'm going to look into changing govuk-frontend-diff
in the short term to allow us to get this release out ASAP. Following that, to re-write the test suite using pytest. Thanks again 👍🏻
Superb detective work @leohemsted! I'm not completely averse to releasing another govuk-frontend-diff if we know what the fix should be.
Rewriting the govuk-frontend-jinja tests is 100% the right way to fix it (And I have been badgering Matt to do this for a while 😆). In the short term though @matthew-shaw - it would be even easier to simply bypass this set of tests in the pipeline for this repo and manually verify that the output is correct. The tests are obviously an important thing in keeping the library stable over time, but if you are sufficiently happy that your output is correct, and you can confidently point to why the tests are failing then I don't see why you wouldn't simply release this package anyway.
And then crack on with rewriting the tests, or fixing govuk-frontend-diff in the short term. But I don't think this needs to hold you up.
Favour pragmatism over idealism...
govuk-frontend-diff@1.1.2 is published now containing the fixed from https://github.com/surevine/govuk-frontend-diff/pull/88. In order to use it you just need to update the dockerfile where it downloads it:
https://github.com/LandRegistry/govuk-frontend-jinja/blob/main/tests/utils/Dockerfile
Remaining issues if anyone else looks at this:
Character count component
Test failing: "when neither maxlength nor maxwords are set"
Errors:
and
Thoughts:
Looking at the test input params I can't see why the i18n macro is being called with the incorrect number of params. Other components that have had i18n support added in this release have similar tests that pass.
Tabs component
Test failing: "html as text"
Errors:
Thoughts:
The HTML within the text param does appear to be escaped into its
<p>Panel 1 content</p>
form, but for some reason is being treated as though it's not, resulting in an invalid HTML parsing error fromgovuk-frontend-diff
. Again very confusing as other components test for escaped html within text attributes in the same way and they are passing.