-
Notifications
You must be signed in to change notification settings - Fork 10
Fix base element href include localhost #271
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
Conversation
75b4245
to
d17472e
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #271 +/- ##
==========================================
+ Coverage 95.64% 95.73% +0.09%
==========================================
Files 14 14
Lines 390 399 +9
Branches 67 69 +2
==========================================
+ Hits 373 382 +9
Misses 17 17 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9127448
to
1876eb8
Compare
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.
Looks good, but I left a comment that I'd like to resolve before approving.
40d1594
to
599df78
Compare
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 adding a separate test for this. Looks great! 👍🏻
Issue: #AP-6057
What Changed
When the app use a base url, it's usually a path like
/some/path
. But the DOM snapshot output that we are getting localhost value. This PR remove the localhost value if there is any, if the base url doesn't includelocalhost
, return whatever value as it is.How to test
Before fix: https://6595c5968c95bd964ba59382-ukxkpmtgaw.chromatic.com/?path=/story/archiving-assets-assets-from-css-urls-are-archived--snapshot-1&globals=viewport:w1000h660
After fix: https://6595c5968c95bd964ba59382-wxgdisaoqj.chromatic.com/?path=/story/archiving-assets-assets-from-css-urls-are-archived--snapshot-1&globals=viewport:w1000h660
<base href="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/" />
to this pagetest-server/fixtures/asset-paths/css-urls.html
yarn test:cypress
, thenyarn archive-storybook:cypress
to observe this storyassets-from-css-urls-are-archived--snapshot
. You can notice some images are missing./
instead ofhttp://localhost300
.