Add Google Pay golden request tests - #70
Conversation
3123efe to
6bc8081
Compare
The Android Google Pay request had no structural fixture tests, so a default or a configured field could drift from the web SDK without a focused failure. GooglePayGoldenRequestTest compares the full request projection with billing-enabled, billing-disabled, and custom fixtures. The fixtures are shared with the web SDK under packages/ui-components/test/fixtures/google-pay.
6bc8081 to
1cff608
Compare
| private val transaction = Transaction( | ||
| country = "IE", | ||
| currency = "EUR", | ||
| total = Amount.ofMinorUnits(5499), |
There was a problem hiding this comment.
nit: we use Amount.ofMinorUnits(5499) here vs. Amount("54.99") in the neighboring PaymentRequestTest.kt - maybe a good idea to stick to just one of them
(functionally identical, just an inconsistent style choice between the two test files)
Doesn't have to be part of this pr though.
| * Fixture tests for the whole Google Pay payment request. | ||
| * | ||
| * These fixtures are shared with the web SDK's `packages/ui-components/test/fixtures/google-pay`. | ||
| * Keep the two copies identical so a default that drifts on one platform fails here. |
There was a problem hiding this comment.
We can create a claude bot (similar to Matt's one that checks docs vs code changes) to check every now and then that the fixtures are identical (for Android and iOS)
Or there might be ready solutions for that
I don't think we have time and/or need to do it as part of this project, but could be a good ticket for the next iteration or just a backlog.
ana-maksimovskikh
left a comment
There was a problem hiding this comment.
LGTM, thanks you 🚀
The Android Google Pay request had no whole-request test, so defaults and configured fields could change without a focused failure.
GooglePayGoldenRequestTestnow compares billing-disabled, billing-enabled, and custom requests with strict JSON fixtures.The shared projection excludes Android-only
displayItems[].status; a separate test covers that field. The fixtures match the web SDK copies byte-for-byte, but no CI check enforces that yet.Stacked on #72. Both PRs must wait for the next major Android SDK release.