braintree / braintree_ios

Braintree SDK for iOS
https://developer.paypal.com/braintree/docs/start/hello-client/ios/v5
MIT License
557 stars 291 forks source link

[QL] Handle Success or Failure of `application.open` #1246

Closed jaxdesmarais closed 4 months ago

jaxdesmarais commented 4 months ago

Summary of changes

Checklist

Authors

scannillo commented 4 months ago

Changes look good! But I think this needs 2 unit tests based on the bool result of application.open(redirectURL, options: [:])

jaxdesmarais commented 4 months ago

Changes look good! But I think this needs 2 unit tests based on the bool result of application.open(redirectURL, options: [:])

It looks like there is a test testTokenizeVaultAccount_whenPayPalAppApprovalURLPresent_attemptsAppSwitchWithParameters that is already asserting on this result. As far as testing the inverse, it looks like we always hardcode the result of application.open to success here so we don't actually have any tests around the failure case: https://github.com/braintree/braintree_ios/blob/4d4f107700b1483addeae0b3b7c741014f398a5d/UnitTests/BraintreeTestShared/FakeApplication.swift#L15

scannillo commented 4 months ago

As far as testing the inverse, it looks like we always hardcode the result of application.open to success here so we don't actually have any tests around the failure case:

Added a test for the failure case + error in this commit 4123bcf33938ee48c99af2d4805648c4178ff441