2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-19 09:25:34 +00:00

[fenix] Close https://github.com/mozilla-mobile/fenix/issues/20945: Fix failing test in AccountSettingsInteractorTest

This commit is contained in:
Jonathan Almeida 2021-08-20 12:51:00 -04:00 committed by mergify[bot]
parent eae779d231
commit d2b9962319

View File

@ -37,7 +37,8 @@ class AccountSettingsInteractorTest {
@Test
fun onChangeDeviceName() {
val store: AccountSettingsFragmentStore = mockk(relaxed = true)
val invalidNameResponse = mockk<() -> Unit>(relaxed = true)
var invalidResponseInvoked = false
val invalidNameResponse = { invalidResponseInvoked = true }
val interactor = AccountSettingsInteractor(
mockk(),
@ -49,13 +50,14 @@ class AccountSettingsInteractorTest {
assertTrue(interactor.onChangeDeviceName("New Name", invalidNameResponse))
verify { store.dispatch(AccountSettingsFragmentAction.UpdateDeviceName("New Name")) }
verify { invalidNameResponse wasNot Called }
assertFalse(invalidResponseInvoked)
}
@Test
fun onChangeDeviceNameSyncFalse() {
val store: AccountSettingsFragmentStore = mockk(relaxed = true)
val invalidNameResponse = mockk<() -> Unit>(relaxed = true)
var invalidResponseInvoked = false
val invalidNameResponse = { invalidResponseInvoked = true }
val interactor = AccountSettingsInteractor(
mockk(),
@ -67,7 +69,7 @@ class AccountSettingsInteractorTest {
assertFalse(interactor.onChangeDeviceName("New Name", invalidNameResponse))
verify { store wasNot Called }
verify { invalidNameResponse() }
assertTrue(invalidResponseInvoked)
}
@Test