summaryrefslogtreecommitdiffhomepage
path: root/android/app/src/androidTest
diff options
context:
space:
mode:
authorDavid Göransson <david.goransson@mullvad.net>2025-07-09 11:07:29 +0200
committerDavid Göransson <david.goransson@mullvad.net>2025-07-09 16:14:00 +0200
commit92f6e03753f465d21d1577de2a297b6455429772 (patch)
treebe679c7f6c7c9e5bae5b64db3af0cbd7eb32d21e /android/app/src/androidTest
parentdec7b65876819256e2bd018c0e4804e45f2c7578 (diff)
downloadmullvadvpn-92f6e03753f465d21d1577de2a297b6455429772.tar.xz
mullvadvpn-92f6e03753f465d21d1577de2a297b6455429772.zip
Remove nullable paymentState
Diffstat (limited to 'android/app/src/androidTest')
-rw-r--r--android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/component/AddTimeBottomSheetTest.kt50
1 files changed, 40 insertions, 10 deletions
diff --git a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/component/AddTimeBottomSheetTest.kt b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/component/AddTimeBottomSheetTest.kt
index 095c15dafc..893ac23825 100644
--- a/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/component/AddTimeBottomSheetTest.kt
+++ b/android/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/component/AddTimeBottomSheetTest.kt
@@ -78,7 +78,7 @@ class AddTimeBottomSheetTest {
state =
AddTimeUiState(
purchaseState = null,
- billingPaymentState = null,
+ billingPaymentState = PaymentState.NoPayment,
showSitePayment = true,
tunnelStateBlocked = false,
)
@@ -102,7 +102,7 @@ class AddTimeBottomSheetTest {
state =
AddTimeUiState(
purchaseState = null,
- billingPaymentState = null,
+ billingPaymentState = PaymentState.NoPayment,
tunnelStateBlocked = false,
showSitePayment = true,
)
@@ -271,12 +271,21 @@ class AddTimeBottomSheetTest {
fun testShowPurchaseCompleteDialog() =
composeExtension.use {
// Arrange
+ val productId = ProductId(ProductIds.ThreeMonths)
initBottomSheet(
state =
AddTimeUiState(
- purchaseState =
- PurchaseState.Success(ProductId(ProductIds.ThreeMonths)),
- billingPaymentState = null,
+ purchaseState = PurchaseState.Success(productId),
+ billingPaymentState =
+ PaymentState.PaymentAvailable(
+ listOf(
+ PaymentProduct(
+ productId = productId,
+ price = ProductPrice("$30"),
+ status = null,
+ )
+ )
+ ),
tunnelStateBlocked = false,
showSitePayment = false,
)
@@ -292,10 +301,20 @@ class AddTimeBottomSheetTest {
fun testShowVerificationErrorDialog() =
composeExtension.use {
// Arrange
+ val productId = ProductId(ProductIds.ThreeMonths)
initBottomSheet(
AddTimeUiState(
purchaseState = PurchaseState.VerifyingPurchase,
- billingPaymentState = null,
+ billingPaymentState =
+ PaymentState.PaymentAvailable(
+ listOf(
+ PaymentProduct(
+ productId = productId,
+ price = ProductPrice("$30"),
+ status = null,
+ )
+ )
+ ),
tunnelStateBlocked = false,
showSitePayment = false,
)
@@ -310,11 +329,22 @@ class AddTimeBottomSheetTest {
fun testShowFetchProductsErrorDialog() =
composeExtension.use {
// Arrange
+
+ val productId = ProductId(ProductIds.ThreeMonths)
initBottomSheet(
state =
AddTimeUiState(
- purchaseState = PurchaseState.Error.OtherError(ProductId("ProductId")),
- billingPaymentState = null,
+ purchaseState = PurchaseState.Error.OtherError(productId),
+ billingPaymentState =
+ PaymentState.PaymentAvailable(
+ listOf(
+ PaymentProduct(
+ productId = productId,
+ price = ProductPrice("$30"),
+ status = null,
+ )
+ )
+ ),
tunnelStateBlocked = false,
showSitePayment = false,
)
@@ -336,7 +366,7 @@ class AddTimeBottomSheetTest {
state =
AddTimeUiState(
purchaseState = null,
- billingPaymentState = null,
+ billingPaymentState = PaymentState.NoPayment,
tunnelStateBlocked = false,
showSitePayment = false,
)
@@ -355,7 +385,7 @@ class AddTimeBottomSheetTest {
state =
AddTimeUiState(
purchaseState = null,
- billingPaymentState = null,
+ billingPaymentState = PaymentState.NoPayment,
tunnelStateBlocked = true,
showSitePayment = true,
)