Skip to content

test(rn): assert Android error code parity with errors.ts - #576

Draft
kieran-osgood-shopify wants to merge 1 commit into
kieran-osgood/07-16-featupdatereact-nativetousenewnativecolorschemepropertiesfrom
kieran-osgood/rn-error-code-docs-and-parity
Draft

test(rn): assert Android error code parity with errors.ts#576
kieran-osgood-shopify wants to merge 1 commit into
kieran-osgood/07-16-featupdatereact-nativetousenewnativecolorschemepropertiesfrom
kieran-osgood/rn-error-code-docs-and-parity

Conversation

@kieran-osgood-shopify

Copy link
Copy Markdown
Contributor

What changes are you making?

errors.ts carried no documentation, so the API report listed every member as // (undocumented). Add a doc comment to each one, and mark webViewNotSupported as Android only — Android System WebView updates apart from the operating system and can lack WebMessageListener, and iOS reports no equivalent.

Add CheckoutErrorCodeParityTest. It enumerates CheckoutErrorCode from the published Android artifact and asserts each code appears in src/errors.ts. errors.ts is hand-maintained and silently coerces an unlisted native code to unknown, so nothing caught a missing member before.

Declare ../src/errors.ts as a Test task input in android/build.gradle. Without it Gradle reports testDebugUnitTest UP-TO-DATE and the test passes on stale state.

How to test

dev rn test android

Red first: delete a member from errors.ts and confirm the test names the missing code.

Stacked on #484.


🤖 Generated with Claude Code

@kieran-osgood-shopify
kieran-osgood-shopify requested a review from a team as a code owner August 5, 2026 09:11
@github-actions github-actions Bot added the #gsd:50662 Rebase Checkout Kit on UCP label Aug 5, 2026
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

React Native — Coverage Report

Lines Statements Branches Functions
Coverage: 92%
91.74% (311/339) 88.11% (178/202) 100% (83/83)

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown

Package Size

Platform Artifact Base Head Delta
React Native npm tarball 101.8 KiB 103.0 KiB +1.2 KiB
React Native file breakdown
File Base Head Delta
node_modules/@shopify/checkout-kit-protocol/src/generated/Models.ts 85.4 KiB 85.4 KiB 0 B
node_modules/@shopify/checkout-kit-protocol/src/generated/Models.d.ts 53.0 KiB 53.0 KiB 0 B
ios/AcceleratedCheckoutButtons.swift 14.1 KiB 14.1 KiB 0 B
ios/ShopifyCheckoutKit.swift 13.6 KiB 13.6 KiB 0 B
src/components/AcceleratedCheckoutButtons.tsx 13.0 KiB 13.0 KiB 0 B
lib/commonjs/index.js 12.3 KiB 12.3 KiB 0 B
src/index.ts 12.2 KiB 12.2 KiB 0 B
android/src/main/java/com/shopify/reactnative/checkoutkit/ShopifyCheckoutKitModule.java 12.1 KiB 12.1 KiB 0 B
lib/commonjs/components/AcceleratedCheckoutButtons.js 11.4 KiB 11.4 KiB 0 B
lib/commonjs/components/AcceleratedCheckoutButtons.js.map 10.4 KiB 10.4 KiB 0 B
lib/module/components/AcceleratedCheckoutButtons.js 10.2 KiB 10.2 KiB 0 B
lib/module/index.js 10.2 KiB 10.2 KiB 0 B
node_modules/@shopify/checkout-kit-protocol/src/generated/ProtocolNotifications.ts 9.5 KiB 9.5 KiB 0 B
lib/module/components/AcceleratedCheckoutButtons.js.map 9.1 KiB 9.1 KiB 0 B
src/index.d.ts 8.8 KiB 8.8 KiB 0 B
src/present-dispatcher.ts 8.0 KiB 8.0 KiB 0 B
lib/module/index.js.map 7.9 KiB 7.9 KiB 0 B
lib/commonjs/index.js.map 7.7 KiB 7.7 KiB 0 B
node_modules/@shopify/checkout-kit-protocol/src/generated/ProtocolNotifications.d.ts 7.6 KiB 7.6 KiB 0 B
node_modules/@shopify/checkout-kit-protocol/src/generated/ProtocolRenameMap.ts 7.2 KiB 7.2 KiB 0 B
…and 110 smaller files

Measured from the PR base SHA and PR head SHA. The file breakdown shows uncompressed sizes within each package artifact, so individual files do not sum to the compressed artifact total. This comment reports package artifact sizes only; it is not a final app binary-size report.

@bitrise

bitrise Bot commented Aug 5, 2026

Copy link
Copy Markdown

Install this build

Open Tophat, select your target device, then click Install. Links open on the Mac running Tophat.

SDK Install
React Native Install with Tophat

Checkout Kit E2E results

Status Suite Target Platform OS version tag Device
tests/shared/launch-smoke.yaml react-native ios latest iPhone 15
iOS 27 Beta
tests/shared/launch-smoke.yaml react-native android latest Google Pixel 9
Android 17.0

@kieran-osgood-shopify
kieran-osgood-shopify marked this pull request as draft August 5, 2026 09:35
…ative enum

Name the single supported platform on `webViewNotSupported`, because Android
System WebView can lack `WebMessageListener` and iOS never sends the code.
Every other member arrives from both platforms.

Add a Kotlin parity test that fails when the native enum gains a code that
`src/errors.ts` does not declare. Declare `src/errors.ts` as a test input, so
Gradle does not report a stale pass after that file changes.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the kieran-osgood/07-16-featupdatereact-nativetousenewnativecolorschemeproperties branch from 80eb817 to f6e022b Compare August 5, 2026 09:52
@kieran-osgood-shopify
kieran-osgood-shopify force-pushed the kieran-osgood/rn-error-code-docs-and-parity branch from 9d3a9a1 to 3a69f5b Compare August 5, 2026 09:52

Copy link
Copy Markdown
Contributor Author

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:50662 Rebase Checkout Kit on UCP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant