-
-
Notifications
You must be signed in to change notification settings - Fork 400
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: add integration tests that check the HTML content of different types of pages + fix issues #10043
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't this PR going to break hackish parsing done mobile side on the assumption that error messages are in English ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great.
I'm a bit sceptic that we don't remove spaces in html (reformat html to a well defined format) because it will induce changes on very basic changes in the template, but it's ok.
We could also consider adding something like https://metacpan.org/pod/Test::HTML::Tidy (or https://metacpan.org/pod/HTML::T5 ?)
lib/ProductOpener/Display.pm
Outdated
# We need also to remove the canonical URL from the request so that it does not get displayed in the error page | ||
delete $request_ref->{canon_url}; | ||
delete $request_ref->{canon_rel_url}; | ||
delete $request_ref->{url}; | ||
delete $request_ref->{current_link}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shan't we do it in display_error_and_exit ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could, I'll move it.
tests/integration/expected_test_results/export/0850032917148.json
Outdated
Show resolved
Hide resolved
Error messages are not in English. e.g. in prod: https://fr.openfoodfacts.org/fdsfdsfsd/FSDQfsqfdsqfedsq/fdsfqsfd This PR repairs display_error() that was broken by #10008 because we did not have such HTML tests. You can see the issue on staging right now: view-source:https://fr.openfoodfacts.net/fdsfdsfsd/FSDQfsqfdsqfedsq/fdsfqsfd : it's missing the language code in some generated HTML, like "newsletter-" : |
Co-authored-by: Alex Garel <alex@openfoodfacts.org>
…rver into main-html
Quality Gate passedIssues Measures |
…ent types of pages + fix issues (#10043)
This PR merges the #10023 PR with the main branch, and made corrections that were spotted by the new integration tests that compare the generated HTML:
We should be able to catch more types of errors with those new tests going forward.