You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No tests for the iOS PaymentDelegate or the Android sheet-result paths #64
The most intricate lifecycle code has no native tests:
iOSPaymentDelegate (HybridPaymentHandler.swift:494-635): onAuthorize success, failure, rejection and 25 s timeout; a late result after the timeout; didFinish while authorizing (finishedWhileAuthorizing); a second attempt after failure; cancel before authorization; shipping-method change.
AndroidHybridPaymentHandler (HybridPaymentHandler.kt:164-373): RESULT_OK with and without data; RESULT_CANCELED; RESULT_ERROR with a status; an unknown code; no current activity; the authorizePayment timeout against a late result.
The existing tests cover PendingPayment, the presenter, builders and mappers. JS coverage is 99%, but all of it runs against a mocked native module. Past lifecycle bugs (#5, #6, #29, #30, #54) were all in this area.
Suggested fix
Extract the delegate's decisions into pure functions, then test them. For example:
Activity