Skip to content

Commit

Permalink
Fix integration tests and run them only in defaults flavor
Browse files Browse the repository at this point in the history
  • Loading branch information
tonidero committed Jul 20, 2023
1 parent 58592a5 commit 33341fa
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ fun Purchases.Companion.resetSingleton() {
}

var Purchases.forceServerErrors: Boolean
get() = appConfig.forceServerErrors
get() = purchasesOrchestrator.appConfig.forceServerErrors
set(value) {
appConfig.forceServerErrors = value
purchasesOrchestrator.appConfig.forceServerErrors = value
}

var Purchases.forceSigningErrors: Boolean
get() = appConfig.forceSigningErrors
get() = purchasesOrchestrator.appConfig.forceSigningErrors
set(value) {
appConfig.forceSigningErrors = value
purchasesOrchestrator.appConfig.forceSigningErrors = value
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,21 @@ abstract class BaseOfflineEntitlementsWithInitialRequestsCompletedIntegrationTes
}

private fun waitForInitialRequestsToEnd(completion: () -> Unit) {
Purchases.sharedInstance.offlineEntitlementsManager.updateProductEntitlementMappingCacheIfStale {
if (it != null) {
fail("Expected to get product entitlement mapping but got error: $it")
} else {
Purchases.sharedInstance.getCustomerInfoWith(
onError = { customerInfoError ->
fail("Expected to succeed getting customer info. Got $customerInfoError")
},
onSuccess = {
completion()
},
)
Purchases.sharedInstance.purchasesOrchestrator.offlineEntitlementsManager
.updateProductEntitlementMappingCacheIfStale {
if (it != null) {
fail("Expected to get product entitlement mapping but got error: $it")
} else {
Purchases.sharedInstance.getCustomerInfoWith(
onError = { customerInfoError ->
fail("Expected to succeed getting customer info. Got $customerInfoError")
},
onSuccess = {
completion()
},
)
}
}
}
}

// endregion helpers
Expand Down

0 comments on commit 33341fa

Please sign in to comment.