mirror of
https://github.com/bitwarden/android.git
synced 2026-11-20 11:37:52 -06:00
BIT-1962: Add Direct Link to Privacy Policy in About Screen (#1084)
This commit is contained in:
committed by
Álison Fernandes
parent
fc17370223
commit
bd84a8649d
+30
-2
@@ -88,6 +88,22 @@ class AboutScreenTest : BaseComposeTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("MaxLineLength")
|
||||
@Test
|
||||
fun `on privacy policy click should display confirmation dialog and confirm click should emit PrivacyPolicyClick`() {
|
||||
composeTestRule.onNode(isDialog()).assertDoesNotExist()
|
||||
composeTestRule.onNodeWithText("Privacy Policy").performClick()
|
||||
composeTestRule.onNode(isDialog()).assertExists()
|
||||
composeTestRule
|
||||
.onAllNodesWithText("Continue")
|
||||
.filterToOne(hasAnyAncestor(isDialog()))
|
||||
.performClick()
|
||||
composeTestRule.onNode(isDialog()).assertDoesNotExist()
|
||||
verify {
|
||||
viewModel.trySendAction(AboutAction.PrivacyPolicyClick)
|
||||
}
|
||||
}
|
||||
|
||||
@Suppress("MaxLineLength")
|
||||
@Test
|
||||
fun `on bitwarden web vault click should display confirmation dialog and confirm click should emit WebVaultClick`() {
|
||||
@@ -134,6 +150,14 @@ class AboutScreenTest : BaseComposeTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `on NavigateToPrivacyPolicy should call launchUri on IntentManager`() {
|
||||
mutableEventFlow.tryEmit(AboutEvent.NavigateToPrivacyPolicy)
|
||||
verify {
|
||||
intentManager.launchUri("https://bitwarden.com/privacy".toUri())
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `on NavigateToLearnAboutOrganizations should call launchUri on IntentManager`() {
|
||||
mutableEventFlow.tryEmit(AboutEvent.NavigateToLearnAboutOrganizations)
|
||||
@@ -209,7 +233,9 @@ class AboutScreenTest : BaseComposeTest() {
|
||||
|
||||
@Test
|
||||
fun `on version info click should send VersionClick`() {
|
||||
composeTestRule.onNodeWithText("Version: 1.0.0 (1)").performClick()
|
||||
composeTestRule.onNodeWithText("Version: 1.0.0 (1)")
|
||||
.performScrollTo()
|
||||
.performClick()
|
||||
verify {
|
||||
viewModel.trySendAction(AboutAction.VersionClick)
|
||||
}
|
||||
@@ -217,7 +243,9 @@ class AboutScreenTest : BaseComposeTest() {
|
||||
|
||||
@Test
|
||||
fun `version should update according to the state`() = runTest {
|
||||
composeTestRule.onNodeWithText("Version: 1.0.0 (1)").assertIsDisplayed()
|
||||
composeTestRule.onNodeWithText("Version: 1.0.0 (1)")
|
||||
.performScrollTo()
|
||||
.assertIsDisplayed()
|
||||
|
||||
mutableStateFlow.update { it.copy(version = "Version: 1.1.0 (2)".asText()) }
|
||||
|
||||
|
||||
+9
@@ -53,6 +53,15 @@ class AboutViewModelTest : BaseViewModelTest() {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `on PrivacyPolicyClick should emit NavigateToPrivacyPolicy`() = runTest {
|
||||
val viewModel = createViewModel(DEFAULT_ABOUT_STATE)
|
||||
viewModel.eventFlow.test {
|
||||
viewModel.trySendAction(AboutAction.PrivacyPolicyClick)
|
||||
assertEquals(AboutEvent.NavigateToPrivacyPolicy, awaitItem())
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `on LearnAboutOrganizationsClick should emit NavigateToLearnAboutOrganizations`() =
|
||||
runTest {
|
||||
|
||||
Reference in New Issue
Block a user