mirror of
https://github.com/bitwarden/android.git
synced 2025-03-15 18:58:59 +03:00
Add missing test for Trusted Device Screen (#1139)
This commit is contained in:
parent
5b1545f53b
commit
e214c311b1
1 changed files with 11 additions and 0 deletions
|
@ -1,9 +1,12 @@
|
|||
package com.x8bit.bitwarden.ui.auth.feature.trusteddevice
|
||||
|
||||
import androidx.compose.ui.test.onNodeWithContentDescription
|
||||
import androidx.compose.ui.test.performClick
|
||||
import com.x8bit.bitwarden.data.platform.repository.util.bufferedMutableSharedFlow
|
||||
import com.x8bit.bitwarden.ui.platform.base.BaseComposeTest
|
||||
import io.mockk.every
|
||||
import io.mockk.mockk
|
||||
import io.mockk.verify
|
||||
import kotlinx.coroutines.flow.MutableStateFlow
|
||||
import org.junit.Before
|
||||
import org.junit.Test
|
||||
|
@ -35,6 +38,14 @@ class TrustedDeviceScreenTest : BaseComposeTest() {
|
|||
mutableEventFlow.tryEmit(TrustedDeviceEvent.NavigateBack)
|
||||
assertTrue(onNavigateBackCalled)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `on back click should send BackClick`() {
|
||||
composeTestRule.onNodeWithContentDescription("Close").performClick()
|
||||
verify(exactly = 1) {
|
||||
viewModel.trySendAction(TrustedDeviceAction.BackClick)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private val DEFAULT_STATE: TrustedDeviceState = TrustedDeviceState
|
||||
|
|
Loading…
Add table
Reference in a new issue