-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix integration tests and change to a different project #1123
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,7 +91,7 @@ class PurchasesIntegrationTest : BasePurchasesIntegrationTest() { | |
onSuccess = { offerings -> | ||
assertThat(offerings.current).isNotNull | ||
assertThat(offerings.current?.availablePackages?.size).isEqualTo(1) | ||
assertThat(offerings.current?.monthly?.product?.sku).isEqualTo(Constants.productIdToPurchase) | ||
assertThat(offerings.current?.annual?.product?.sku).isEqualTo(Constants.productIdToPurchase) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I changed the project to a new one that only has an annual sku. The idea behind that is that we plan to have a real purchase of an annual sku so we can do better integration tests |
||
|
||
assertThat(offerings.current?.metadata).isNotNull | ||
assertThat(offerings.current?.metadata?.get("dontdeletethis")).isEqualTo("useforintegrationtesting") | ||
|
@@ -114,7 +114,7 @@ class PurchasesIntegrationTest : BasePurchasesIntegrationTest() { | |
onSuccess = { offerings -> | ||
assertThat(offerings.current).isNotNull | ||
assertThat(offerings.current?.availablePackages?.size).isEqualTo(1) | ||
assertThat(offerings.current?.monthly?.product?.sku).isEqualTo(Constants.productIdToPurchase) | ||
assertThat(offerings.current?.annual?.product?.sku).isEqualTo(Constants.productIdToPurchase) | ||
latch.countDown() | ||
}, | ||
) | ||
|
@@ -128,7 +128,7 @@ class PurchasesIntegrationTest : BasePurchasesIntegrationTest() { | |
onSuccess = { newOfferings -> | ||
assertThat(newOfferings.current).isNotNull | ||
assertThat(newOfferings.current?.availablePackages?.size).isEqualTo(1) | ||
assertThat(newOfferings.current?.monthly?.product?.sku).isEqualTo(Constants.productIdToPurchase) | ||
assertThat(newOfferings.current?.annual?.product?.sku).isEqualTo(Constants.productIdToPurchase) | ||
|
||
latch.countDown() | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ abstract class BaseOfflineEntitlementsIntegrationTest : BasePurchasesIntegration | |
) | ||
|
||
// Hack until we get a running token for production API tests. After that, we can just use "entitlementsToVerify" | ||
private val expectedEntitlements = entitlementsToVerify.ifEmpty { listOf("pro_cat", "another_pro_4") } | ||
private val expectedEntitlements = entitlementsToVerify.ifEmpty { listOf("pro_cat") } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Needed as part of the changes to the new project. |
||
|
||
// region helpers | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,11 +16,11 @@ internal class ProductionBackendIntegrationTest: BaseBackendIntegrationTest() { | |
ensureBlockFinishes { latch -> | ||
backend.getProductEntitlementMapping( | ||
onSuccessHandler = { productEntitlementMapping -> | ||
assertThat(productEntitlementMapping.mappings.size).isEqualTo(36) | ||
assertThat(productEntitlementMapping.mappings["annual_freetrial"]).isEqualTo( | ||
assertThat(productEntitlementMapping.mappings.size).isEqualTo(2) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also needed as part of the changes to the new project. |
||
assertThat(productEntitlementMapping.mappings["cheapest_subs"]).isEqualTo( | ||
ProductEntitlementMapping.Mapping( | ||
productIdentifier = "annual_freetrial", | ||
basePlanId = "p1y", | ||
productIdentifier = "cheapest_subs", | ||
basePlanId = "annual", | ||
entitlements = listOf("pro_cat") | ||
) | ||
) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Had to change the visibility of these after #1106, otherwise it wouldn't compile