-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Category content upload media minify#31633 #32398
Category content upload media minify#31633 #32398
Conversation
Merge from magento
pull from origin
update fork
pull origin
pull origin
Hi @gixid192. Thank you for your contribution
❗ Automated tests can be triggered manually with an appropriate comment:
You can find more information about the builds here ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review. For more details, please, review the Magento Contributor Guide documentation. 🕙 You can find the schedule on the Magento Community Calendar page. 📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket. 🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel ✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel |
@magento run all tests |
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.
Hi @gixid192,
Could you cover your changes with any type of automated test?
I was wondering if I should write tests for this PR. Do you think that it is necessary to write tests on this case? |
@gixid192 It's obvious that this code isn't new, but it was breaking in some cases. According to Magento Definition of Done - all code changes must be covered by automated tests (if possible). This is needed to make sure we'll not re-introduce it again in the future. |
@magento run Functional Tests B2B, Functional Tests EE, Integration Tests, WebAPI Tests |
@magento run Functional Tests EE |
@ihor-sviziev The tests are all green now. So I assume the code is correct. In case you still want a test for this PR, could you suggest a way? I mean, the error only happens when source is minified, how to test this, what kind of this test is this called? Also, as the whitespace and \s are all most the same, what should I write a test to differentiate those 2? I don't have much experience writing test so any help would be great. |
Hi @gixid192, |
Hi @ihor-sviziev, thank you for the review. |
Hi @gixid192, thank you for your contribution! |
Description (*)
The current regex syntax uses literal space (blank character) which leads to the elimination when applying minification process.
The fix simply changes blank character to
\s
, which is whitespace in regex rule/syntax.Fixed Issues (if relevant)
Fixes #31633
Contribution checklist (*)