Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Rawa committed Sep 2, 2024
1 parent 0d0bb2b commit 93a7faf
Showing 1 changed file with 5 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import io.mockk.MockKAnnotations
import io.mockk.every
import io.mockk.mockk
import io.mockk.verify
import kotlinx.coroutines.flow.MutableSharedFlow
import kotlinx.coroutines.flow.asSharedFlow
import net.mullvad.mullvadvpn.compose.createEdgeToEdgeComposeExtension
import net.mullvad.mullvadvpn.compose.setContentWithTheme
import net.mullvad.mullvadvpn.compose.state.PaymentState
Expand All @@ -21,7 +19,6 @@ import net.mullvad.mullvadvpn.lib.payment.model.PaymentStatus
import net.mullvad.mullvadvpn.lib.payment.model.ProductId
import net.mullvad.mullvadvpn.lib.payment.model.ProductPrice
import net.mullvad.mullvadvpn.viewmodel.AccountUiState
import net.mullvad.mullvadvpn.viewmodel.AccountViewModel
import org.junit.jupiter.api.BeforeEach
import org.junit.jupiter.api.Test
import org.junit.jupiter.api.extension.RegisterExtension
Expand All @@ -48,8 +45,7 @@ class AccountScreenTest {
accountNumber = DUMMY_ACCOUNT_NUMBER,
accountExpiry = null,
showSitePayment = false,
),
uiSideEffect = MutableSharedFlow<AccountViewModel.UiSideEffect>().asSharedFlow(),
)
)
}

Expand All @@ -72,8 +68,6 @@ class AccountScreenTest {
accountNumber = DUMMY_ACCOUNT_NUMBER,
accountExpiry = null,
),
uiSideEffect =
MutableSharedFlow<AccountViewModel.UiSideEffect>().asSharedFlow(),
onManageAccountClick = mockedClickHandler,
)
}
Expand All @@ -99,8 +93,6 @@ class AccountScreenTest {
accountExpiry = null,
showSitePayment = false,
),
uiSideEffect =
MutableSharedFlow<AccountViewModel.UiSideEffect>().asSharedFlow(),
onRedeemVoucherClick = mockedClickHandler,
)
}
Expand All @@ -126,8 +118,6 @@ class AccountScreenTest {
accountExpiry = null,
showSitePayment = false,
),
uiSideEffect =
MutableSharedFlow<AccountViewModel.UiSideEffect>().asSharedFlow(),
onLogoutClick = mockedClickHandler,
)
}
Expand All @@ -147,8 +137,7 @@ class AccountScreenTest {
AccountScreen(
state =
AccountUiState.default()
.copy(billingPaymentState = PaymentState.Error.Billing),
uiSideEffect = MutableSharedFlow<AccountViewModel.UiSideEffect>().asSharedFlow(),
.copy(billingPaymentState = PaymentState.Error.Billing)
)
}

Expand All @@ -170,8 +159,7 @@ class AccountScreenTest {
.copy(
billingPaymentState =
PaymentState.PaymentAvailable(listOf(mockPaymentProduct))
),
uiSideEffect = MutableSharedFlow<AccountViewModel.UiSideEffect>().asSharedFlow(),
)
)
}

Expand All @@ -193,8 +181,7 @@ class AccountScreenTest {
.copy(
billingPaymentState =
PaymentState.PaymentAvailable(listOf(mockPaymentProduct))
),
uiSideEffect = MutableSharedFlow<AccountViewModel.UiSideEffect>().asSharedFlow(),
)
)
}

Expand All @@ -218,8 +205,6 @@ class AccountScreenTest {
billingPaymentState =
PaymentState.PaymentAvailable(listOf(mockPaymentProduct))
),
uiSideEffect =
MutableSharedFlow<AccountViewModel.UiSideEffect>().asSharedFlow(),
navigateToVerificationPendingDialog = mockNavigateToVerificationPending,
)
}
Expand All @@ -245,8 +230,7 @@ class AccountScreenTest {
.copy(
billingPaymentState =
PaymentState.PaymentAvailable(listOf(mockPaymentProduct))
),
uiSideEffect = MutableSharedFlow<AccountViewModel.UiSideEffect>().asSharedFlow(),
)
)
}

Expand All @@ -272,7 +256,6 @@ class AccountScreenTest {
PaymentState.PaymentAvailable(listOf(mockPaymentProduct))
),
onPurchaseBillingProductClick = clickHandler,
uiSideEffect = MutableSharedFlow<AccountViewModel.UiSideEffect>().asSharedFlow(),
)
}

Expand Down

0 comments on commit 93a7faf

Please sign in to comment.