-
Notifications
You must be signed in to change notification settings - Fork 842
Add comprehensive tests for checkout deduplication logic #46498
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
Add comprehensive tests for checkout deduplication logic #46498
Conversation
Co-authored-by: chihsuan <4344253+chihsuan@users.noreply.github.com>
Co-authored-by: chihsuan <4344253+chihsuan@users.noreply.github.com>
Co-authored-by: chihsuan <4344253+chihsuan@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 🔴 Action required: Please include detailed testing steps, explaining how to test your change, like so: 🔴 Action required: We would recommend that you add a section to the PR description to specify whether this PR includes any changes to data or privacy, like so: 🔴 Action required: Please add missing changelog entries for the following projects: Use the Jetpack CLI tool to generate changelog entries by running the following command: Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
c6915cd
into
fix/deduplicate-product-checkout-event
* Initial plan * Add comprehensive tests for checkout deduplication logic Co-authored-by: chihsuan <4344253+chihsuan@users.noreply.github.com> * Refactor cookie setup into helper methods to reduce duplication Co-authored-by: chihsuan <4344253+chihsuan@users.noreply.github.com> * Address code review feedback: improve test patterns Co-authored-by: chihsuan <4344253+chihsuan@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: chihsuan <4344253+chihsuan@users.noreply.github.com>
The checkout tracking deduplication logic in
should_track_checkout()andmark_checkout_tracked()had no test coverage despite being critical for preventing duplicateproduct_checkoutevents.Changes
mark_checkout_tracked()correctly stores tracking flag and session IDset_session_cookie()andclear_session_cookie()to reduce duplicationAll tests use reflection to access private methods and integrate with existing WC_Session mock infrastructure.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.