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

Refactor payment sheet event tests #10314

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

tianzhao-stripe
Copy link
Contributor

Summary

parameterizing some payment sheet event tests
factoring out defaultPaymentSuccessEventParams
made PaymentMethodFixtures.LINK_INLINE_PAYMENT_SELECTION

Motivation

Make testing easier.
Reduce technical debt.

Testing

  • Added tests
  • Modified tests
  • Manually verified

Screenshots

N.A.

Changelog

N.A.

Copy link
Contributor

github-actions bot commented Mar 5, 2025

Diffuse output:

OLD: identity-example-release-base.apk (signature: V1, V2)
NEW: identity-example-release-pr.apk (signature: V1, V2)

          │          compressed          │         uncompressed         
          ├───────────┬───────────┬──────┼───────────┬───────────┬──────
 APK      │ old       │ new       │ diff │ old       │ new       │ diff 
──────────┼───────────┼───────────┼──────┼───────────┼───────────┼──────
      dex │     2 MiB │     2 MiB │  0 B │   4.1 MiB │   4.1 MiB │  0 B 
     arsc │     1 MiB │     1 MiB │  0 B │     1 MiB │     1 MiB │  0 B 
 manifest │   2.3 KiB │   2.3 KiB │  0 B │     8 KiB │     8 KiB │  0 B 
      res │ 302.6 KiB │ 302.6 KiB │  0 B │ 456.7 KiB │ 456.7 KiB │  0 B 
   native │   6.2 MiB │   6.2 MiB │  0 B │  15.8 MiB │  15.8 MiB │  0 B 
    asset │   6.1 KiB │   6.1 KiB │  0 B │   5.9 KiB │   5.9 KiB │  0 B 
    other │  95.1 KiB │  95.1 KiB │ +1 B │ 182.2 KiB │ 182.2 KiB │  0 B 
──────────┼───────────┼───────────┼──────┼───────────┼───────────┼──────
    total │   9.6 MiB │   9.6 MiB │ +1 B │  21.6 MiB │  21.6 MiB │  0 B 

 DEX     │ old   │ new   │ diff      
─────────┼───────┼───────┼───────────
   files │     1 │     1 │ 0         
 strings │ 20119 │ 20119 │ 0 (+0 -0) 
   types │  6224 │  6224 │ 0 (+0 -0) 
 classes │  5018 │  5018 │ 0 (+0 -0) 
 methods │ 30008 │ 30008 │ 0 (+0 -0) 
  fields │ 17362 │ 17362 │ 0 (+0 -0) 

 ARSC    │ old  │ new  │ diff 
─────────┼──────┼──────┼──────
 configs │  164 │  164 │  0   
 entries │ 3643 │ 3643 │  0
APK
   compressed    │   uncompressed   │                        
──────────┬──────┼───────────┬──────┤                        
 size     │ diff │ size      │ diff │ path                   
──────────┼──────┼───────────┼──────┼────────────────────────
 28.9 KiB │ +2 B │    64 KiB │  0 B │ ∆ META-INF/CERT.SF     
  1.2 KiB │ -2 B │   1.2 KiB │  0 B │ ∆ META-INF/CERT.RSA    
 25.7 KiB │ +1 B │  63.9 KiB │  0 B │ ∆ META-INF/MANIFEST.MF 
──────────┼──────┼───────────┼──────┼────────────────────────
 55.7 KiB │ +1 B │ 129.1 KiB │  0 B │ (total)

@tianzhao-stripe tianzhao-stripe force-pushed the refactor-paymentSheetEventTest branch from a2aaf96 to 4a9c06c Compare March 5, 2025 18:02
Copy link
Collaborator

@amk-stripe amk-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The link inline change LGTM. I'm not convinced that the PaymentSheetEventTest change is a net-positive, left a comment about that.

Also a tip for the future: I think this could have been two PRs (one for the link inline changes, one for the changes to PaymentSheetEventTest). Just makes it easier to review and also for you to get your changes merged

"is_decoupled" to false,
"link_enabled" to false,
"google_pay_enabled" to false,
defaultPaymentSuccessEventParams.plus(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure there's much of an advantage to making this change -- it doesn't improve the error message if tests fail at all and it makes our tests less explicit (ie it's harder to tell what exactly we are asserting on). It does reduce duplication, but at the cost of making the tests less explicit and I'm not sure the trade off is worth it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants