Skip to content
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

Improve integration tests for deferred intent UPE #6882

Closed
FangedParakeet opened this issue Jul 31, 2023 · 3 comments · Fixed by #7664
Closed

Improve integration tests for deferred intent UPE #6882

FangedParakeet opened this issue Jul 31, 2023 · 3 comments · Fixed by #7664
Assignees
Labels
component: stripe link The issues/PRs related to the StripeLink project component: tests Issues related to tests component: upe needs tests The issue/PR needs tests before it can move forward. priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: technical debt This issue/PR represents/solves the technical debt of the project.

Comments

@FangedParakeet
Copy link
Contributor

Description

Currently, in our deferred intent UPE integration work, we have relied greatly on extending existing functionality. Our checkout code inherits the original UPE payment gateway class and relies on the legacy gateway's process_payment function to complete a checkout. Similarly our unit test coverage mostly consists of extending existing UPE unit tests. Consequently our unit test coverage is somewhat lacking in that we neglect to comprehensively the new deferred intent flows of logic from the UPE gateway to the legacy gateway, testing all components in concord concurrently.

It would be nice if we could create some new unit tests that effectively test the deferred intent UPE checkout by ensuring that relevant functions are only fired when necessary, metadata is always added when relevant, and that redundant UPE function calls are no longer made.

Acceptance criteria

Here are a few things of the top of my head that would be nice to have specific integration test coverage for.

  • Complete deferred intent checkout flow.
  • Assert/count calls to payments API (e.g. calls to retrieve payment method, calls to update intent, etc.).
  • Assert intent metadata added to WC order.
  • Assert WC order metadata added to intent.
  • Assert calls to hooks.
  • Platform checkout flow.
  • Assert additional request fields for Stripe Link (e.g. payment_method_types, mandate_data).

Designs

N/A

Testing instructions

Exactly.

Dev notes

Additional context

#6391

@FangedParakeet FangedParakeet added priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. component: tests Issues related to tests needs tests The issue/PR needs tests before it can move forward. component: stripe link The issues/PRs related to the StripeLink project labels Jul 31, 2023
@FangedParakeet
Copy link
Contributor Author

Please add your planning poker estimate with Zenhub @timur27

@timur27
Copy link
Contributor

timur27 commented Aug 3, 2023

Use cases for saving payment methods to check and try to integrate into the testing coverage
#5022 (comment)

@FangedParakeet FangedParakeet added the type: technical debt This issue/PR represents/solves the technical debt of the project. label Sep 6, 2023
@timur27
Copy link
Contributor

timur27 commented Nov 1, 2023

@mdmoore mdmoore self-assigned this Nov 1, 2023
@frosso frosso mentioned this issue Nov 14, 2023
6 tasks
@timur27 timur27 assigned timur27 and unassigned mdmoore Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: stripe link The issues/PRs related to the StripeLink project component: tests Issues related to tests component: upe needs tests The issue/PR needs tests before it can move forward. priority: low The issue/PR is low priority—not many people are affected or there’s a workaround, etc. type: technical debt This issue/PR represents/solves the technical debt of the project.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants