Enhancement/12557 pdf footer#12836
Conversation
… and design consistency.
aaemnnosttv
left a comment
There was a problem hiding this comment.
Thanks @eugene-manuilov – overall LGTM, just the one thing.
…c help center and privacy policy links.
|
Size Change: 0 B Total Size: 2.89 MB ℹ️ View Unchanged
|
…tokens for PDF reports.
aaemnnosttv
left a comment
There was a problem hiding this comment.
Thanks @eugene-manuilov – apologies for the delay.
A few quick points (one particularly important since the help center URL doesn't work as-is).
Otherwise, there are (hopefully minor) merge conflicts to address.
| } | ||
| generatedAt={ generatedAt } | ||
| dashboardURL={ dashboardURL || '' } | ||
| helpCenterURL="https://sitekit.withgoogle.com/support/" |
There was a problem hiding this comment.
This link 404s without the extra params. Let's update this to match what we use in email reports
site-kit-wp/includes/Core/Email_Reporting/templates/parts/footer.php
Lines 63 to 64 in ef3677b
There was a problem hiding this comment.
Oh... not sure why I missed that, but it should be fixed now. Thanks for spotting it. I also went ahead and updated support links to be hardcoded instead of being created with add_query_args for no reason.
| const props = { | ||
| dashboardURL: | ||
| 'http://example.com/wp-admin/index.php?action=googlesitekit_go&to=dashboard', | ||
| helpCenterURL: | ||
| 'http://example.com/wp-admin/index.php?action=googlesitekit_go&to=help-center', | ||
| privacyPolicyURL: | ||
| 'http://example.com/wp-admin/index.php?action=googlesitekit_go&to=privacy-policy', | ||
| }; |
There was a problem hiding this comment.
I realize these are just for the test, but it sets the wrong expectation. Better to use obvious fake values if these tests aren't concerned about these matching the real/expected values and we just want to assert it matches the given props.
There was a problem hiding this comment.
Good call — replaced the realistic golink-style URLs with obvious fakes (https://example.com/dashboard, etc.) so it's clear the test only asserts the props are passed through, not any real URL format.
There was a problem hiding this comment.
Good point, updated.
| /** | ||
| * External dependencies | ||
| */ | ||
| import TestRenderer from 'react-test-renderer'; |
There was a problem hiding this comment.
Is there a reason we're using this instead of the usual react testing library?
There was a problem hiding this comment.
No good reason — switched to the project's standard render from @tests/js/test-utils to match the sibling tests (e.g. PDFEmailReportingNotice.test.tsx), dropping react-test-renderer and the custom collectLinks traversal in favor of container.querySelectorAll( 'pdf-link' ).
aaemnnosttv
left a comment
There was a problem hiding this comment.
LGTM, thanks @eugene-manuilov
|
Older E2E failure is one unrelated test. |
Summary
Addresses issue:
Relevant technical choices
PR Author Checklist
Do not alter or remove anything below. The following sections will be managed by moderators only.
Code Reviewer Checklist
Merge Reviewer Checklist