mirror of
https://github.com/bitwarden/android.git
synced 2026-05-21 20:20:03 -05:00
Add missing test for Trusted Device Screen (#1139)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user