mirror of
https://github.com/bitwarden/android.git
synced 2026-11-19 17:40:12 -06:00
BIT-1101 Adding landscape content and handling scaling better. (#493)
This commit is contained in:
committed by
Álison Fernandes
parent
b6032873ec
commit
da53c72a61
+18
-12
@@ -2,7 +2,6 @@ package com.x8bit.bitwarden.ui.vault.feature.qrcodescan
|
||||
|
||||
import androidx.camera.core.ImageProxy
|
||||
import androidx.compose.ui.test.onNodeWithText
|
||||
import androidx.compose.ui.test.performClick
|
||||
import com.x8bit.bitwarden.data.platform.repository.util.bufferedMutableSharedFlow
|
||||
import com.x8bit.bitwarden.ui.platform.base.BaseComposeTest
|
||||
import com.x8bit.bitwarden.ui.vault.feature.qrcodescan.util.FakeQrCodeAnalyzer
|
||||
@@ -13,6 +12,7 @@ import junit.framework.TestCase.assertTrue
|
||||
import kotlinx.coroutines.test.runTest
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
import org.robolectric.annotation.Config
|
||||
|
||||
class QrCodeScanScreenTest : BaseComposeTest() {
|
||||
|
||||
@@ -44,17 +44,6 @@ class QrCodeScanScreenTest : BaseComposeTest() {
|
||||
assertTrue(onNavigateBackCalled)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `clicking on manual text should send ManualEntryTextClick`() = runTest {
|
||||
composeTestRule
|
||||
.onNodeWithText("Enter key manually")
|
||||
.performClick()
|
||||
|
||||
verify {
|
||||
viewModel.trySendAction(QrCodeScanAction.ManualEntryTextClick)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `when unable to setup camera CameraErrorReceive will be sent`() = runTest {
|
||||
// Because the camera is not set up in the tests, this will always be triggered
|
||||
@@ -86,4 +75,21 @@ class QrCodeScanScreenTest : BaseComposeTest() {
|
||||
viewModel.trySendAction(QrCodeScanAction.QrCodeScanReceive(result))
|
||||
}
|
||||
}
|
||||
|
||||
@Config(qualifiers = "land")
|
||||
@Test
|
||||
fun `clicking on manual text should send ManualEntryTextClick in landscape mode`() = runTest {
|
||||
// TODO Update the tests once clickable text issue is resolved (BIT-1357)
|
||||
composeTestRule
|
||||
.onNodeWithText("Enter key manually", substring = true)
|
||||
.assertExists()
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `clicking on manual text should send ManualEntryTextClick`() = runTest {
|
||||
// TODO Update the tests once clickable text issue is resolved (BIT-1357)
|
||||
composeTestRule
|
||||
.onNodeWithText("Enter key manually", substring = true)
|
||||
.assertExists()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user