-
Notifications
You must be signed in to change notification settings - Fork 354
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate all navigation to compose navigation
Remove old fragments Improve animations between destinations Fix glitch in animation Temporary fix for pending intent flags Fix status bar colors Fix transition for welcome screen Fix bug caused by triggering navigation too fast Fix accidentally not starting service Handle Change log Fix screen rotation Make settings use scaffold snackbar instead Migrate info dialogs to destinations Fix formatting Fix some failed tests Remove unused function Refactor out MTU dialog Migrate DnsDialog Fix Devicelist confirmation dialog Migrate ReportProblemNoEmail dialog Migrate custom WG port to dialog Fix voucher dialog and out of time navigation from connect Fix tests Update gradle lockfile Disable settings button while logging in Add nav graph Fix out of time navigation, transitions and multiple navigation calls. Fix xml formatting Fix test Add CVE supression Clean up build config Remove duplicate deps Fix test
- Loading branch information
Showing
136 changed files
with
3,190 additions
and
3,369 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
...oid/app/src/androidTest/kotlin/net/mullvad/mullvadvpn/compose/dialog/PaymentDialogTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package net.mullvad.mullvadvpn.compose.dialog | ||
|
||
import androidx.compose.ui.test.junit4.createComposeRule | ||
import androidx.compose.ui.test.onNodeWithText | ||
import io.mockk.MockKAnnotations | ||
import net.mullvad.mullvadvpn.compose.dialog.payment.PaymentDialog | ||
import net.mullvad.mullvadvpn.compose.setContentWithTheme | ||
import net.mullvad.mullvadvpn.lib.payment.model.ProductId | ||
import net.mullvad.mullvadvpn.lib.payment.model.PurchaseResult | ||
import net.mullvad.mullvadvpn.util.toPaymentDialogData | ||
import org.junit.Before | ||
import org.junit.Rule | ||
import org.junit.Test | ||
|
||
class PaymentDialogTest { | ||
@get:Rule val composeTestRule = createComposeRule() | ||
|
||
@Before | ||
fun setup() { | ||
MockKAnnotations.init(this) | ||
} | ||
|
||
@Test | ||
fun testShowPurchaseCompleteDialog() { | ||
// Arrange | ||
composeTestRule.setContentWithTheme { | ||
PaymentDialog( | ||
paymentDialogData = PurchaseResult.Completed.Success.toPaymentDialogData()!! | ||
) | ||
} | ||
|
||
// Assert | ||
composeTestRule.onNodeWithText("Time was successfully added").assertExists() | ||
} | ||
|
||
@Test | ||
fun testShowVerificationErrorDialog() { | ||
// Arrange | ||
composeTestRule.setContentWithTheme { | ||
PaymentDialog( | ||
paymentDialogData = | ||
PurchaseResult.Error.VerificationError(null).toPaymentDialogData()!! | ||
) | ||
} | ||
|
||
// Assert | ||
composeTestRule.onNodeWithText("Verifying purchase").assertExists() | ||
} | ||
|
||
@Test | ||
fun testShowFetchProductsErrorDialog() { | ||
// Arrange | ||
composeTestRule.setContentWithTheme { | ||
PaymentDialog( | ||
paymentDialogData = | ||
PurchaseResult.Error.FetchProductsError(ProductId(""), null) | ||
.toPaymentDialogData()!! | ||
) | ||
} | ||
|
||
// Assert | ||
composeTestRule.onNodeWithText("Google Play unavailable").assertExists() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.