mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-23 08:51:30 -05:00
https://github.com/alphagov/notifications-api/pull/2742/files#diff-d9a6761afaff4a491e60b64f6063654fL265 introduced a change in behaviour which causes template preview to 500 for a precompiled letter that is invalid but not because the content is outside the printable area. The changes it back to the previous behaviour, where we b64encode and utf-8 decode for a page that is invalid for reasons that are not content outside the printable area, for example a non portrait a4 letter. I didn't end up writing a unit test for this because I really can't figure out the existing behaviour we expect for this use case. This method is too big and complex but I'm confident by looking at the change in the commit mentioned above that this puts behaviour back to how it was. Manual testing also confirms the fix. I've also taken this opportunity to improve two test names whilst I was looking at things.