Skip to content

Commit 4775d3c

Browse files
authored
Fix the failing unit test in EnterCodeViewModelTest (#6064)
Task/Issue URL: https://app.asana.com/1/137249556945/project/1202552961248957/task/1210249296938447?focus=true ### Description Fixes a failing test. ### Steps to test this PR Make sure all checks are green.
1 parent 4149150 commit 4775d3c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sync/sync-impl/src/test/java/com/duckduckgo/sync/impl/ui/EnterCodeViewModelTest.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,8 @@ internal class EnterCodeViewModelTest {
260260
fun whenProcessCodeAndLoginFailsThenUpdateStateToIdle() = runTest {
261261
whenever(syncAccountRepository.getAccountInfo()).thenReturn(noAccount)
262262
whenever(clipboard.pasteFromClipboard()).thenReturn(jsonRecoveryKeyEncoded)
263-
whenever(syncAccountRepository.processCode(jsonRecoveryKeyEncoded)).thenReturn(Error(code = LOGIN_FAILED.code))
263+
whenever(syncAccountRepository.parseSyncAuthCode(jsonRecoveryKeyEncoded)).thenReturn(Recovery(RecoveryCode(jsonRecoveryKey, primaryKey)))
264+
whenever(syncAccountRepository.processCode(any())).thenReturn(Error(code = LOGIN_FAILED.code))
264265

265266
testee.onPasteCodeClicked()
266267

0 commit comments

Comments
 (0)