-
Notifications
You must be signed in to change notification settings - Fork 67
fix: manage if the BASE_URL does not have the protocol for themes urls #779
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
fix: manage if the BASE_URL does not have the protocol for themes urls #779
Conversation
Thanks for the pull request, @dcoa! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review. 🔘 Get product approvalIf you haven't already, check this list to see if your contribution needs to go through the product review process.
🔘 Provide contextTo help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:
🔘 Get a green buildIf one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green. Where can I find more information?If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources: When can I expect my changes to be merged?Our goal is to get community contributions seen and reviewed as efficiently as possible. However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:
💡 As a result it may take up to several weeks or months to complete a review and merge your PR. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #779 +/- ##
=======================================
Coverage 86.70% 86.71%
=======================================
Files 48 48
Lines 1392 1393 +1
Branches 292 296 +4
=======================================
+ Hits 1207 1208 +1
Misses 172 172
Partials 13 13 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Thanks for updating this!
It's not fully clear to me what the updates to the tests are changing. It looks like the changes are some combination of "this needed to change to get this to pass" and "I want to verify the new functionality of fallbackThemeUrl
." I see those two goals as separate, and I think we can test them separately.
Ideally we'd have tests to show:
- calling
fallbackThemeUrl
with//example.com/my.css
results in//example.com/my.css
- calling
fallbackThemeUrl
withexample.com/my.css
results in//example.com/my.css
- calling
fallbackThemeUrl
withhttp://example.com/my.css
results inhttp://example.com/my.css
- calling
fallbackThemeUrl
withhttps://example.com/my.css
results inhttps://example.com/my.css
Then we could leave the existing tests as untouched as possible - making minimal updates to ensure they still pass.
8b782e0
to
3ec5cb5
Compare
I made test for the function that illustrates all the possible cases at return with The reason why the test was updated is how we are defining the env variables for testing, in this case BASE_URL is just the domain part, needs to resolve as relative url in the test and once the link is created the href returns the url with the http frontend-platform/src/setupTest.js Line 9 in 52a8f2d
Let me know if that should be good, or should I do different change :) @brian-smith-tcril |
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.
LGTM!
Thanks for adding the tests for all the different BASE_URL
cases!
Description:
This PR manages the cases where the protocol is not present in the
BASE_URL
environment variable when is used for creating urls in the themes hook.Merge checklist:
frontend-platform
. This can be done by runningnpm start
and opening http://localhost:8080.module.config.js
file infrontend-build
.fix
,feat
) and is appropriate for your code change. Consider whether your code is a breaking change, and modify your commit accordingly.Post merge: