2
0
mirror of https://github.com/fork-maintainers/iceraven-browser synced 2024-11-11 13:11:01 +00:00

Close #19459: Use Store.waitUntilIdle in intermittent failing test (#19683)

This commit is contained in:
Jonathan Almeida 2021-05-28 02:51:00 +04:00 committed by GitHub
parent 89a1b0016c
commit c50ed5684c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7,7 +7,8 @@ package org.mozilla.fenix.nimbus
import io.mockk.mockk
import io.mockk.verify
import mozilla.components.service.nimbus.NimbusApi
import mozilla.components.support.test.mock
import mozilla.components.support.test.libstate.ext.waitUntilIdle
import org.junit.Assert.assertEquals
import org.junit.Before
import org.junit.Test
import org.mozilla.experiments.nimbus.Branch
@ -23,7 +24,7 @@ class NimbusBranchesControllerTest {
@Before
fun setup() {
nimbusBranchesStore = mock()
nimbusBranchesStore = NimbusBranchesStore(NimbusBranchesState(emptyList()))
controller = NimbusBranchesController(nimbusBranchesStore, experiments, experimentId)
}
@ -36,9 +37,12 @@ class NimbusBranchesControllerTest {
controller.onBranchItemClicked(branch)
nimbusBranchesStore.waitUntilIdle()
verify {
experiments.optInWithBranch(experimentId, branch.slug)
nimbusBranchesStore.dispatch(NimbusBranchesAction.UpdateSelectedBranch(branch.slug))
}
}
assertEquals(branch.slug, nimbusBranchesStore.state.selectedBranch)
}
}