mirror of
https://github.com/bitwarden/android.git
synced 2024-11-23 09:56:11 +03:00
PM-12733: Trim totp codes before saving them (#4315)
This commit is contained in:
parent
e90bd136f6
commit
ffeae93728
2 changed files with 2 additions and 3 deletions
|
@ -46,7 +46,7 @@ class ManualCodeEntryViewModel @Inject constructor(
|
|||
}
|
||||
|
||||
private fun handleCodeSubmit() {
|
||||
vaultRepository.emitTotpCodeResult(TotpCodeResult.Success(state.code))
|
||||
vaultRepository.emitTotpCodeResult(TotpCodeResult.Success(state.code.trim()))
|
||||
sendEvent(ManualCodeEntryEvent.NavigateBack)
|
||||
}
|
||||
|
||||
|
|
|
@ -36,8 +36,7 @@ class ManualCodeEntryViewModelTests : BaseViewModelTest() {
|
|||
|
||||
@Test
|
||||
fun `CodeSubmit should emit new code and NavigateBack`() = runTest {
|
||||
val viewModel =
|
||||
createViewModel(initialState = ManualCodeEntryState("TestCode"))
|
||||
val viewModel = createViewModel(initialState = ManualCodeEntryState(" TestCode "))
|
||||
|
||||
viewModel.eventFlow.test {
|
||||
viewModel.trySendAction(ManualCodeEntryAction.CodeSubmit)
|
||||
|
|
Loading…
Reference in a new issue