Fixing unit tests
This commit is contained in:
parent
f4ef4c2e61
commit
9e3dc4c10f
@ -227,7 +227,6 @@ class OnboardingViewModelTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `given personalisation enabled, when registering account, then updates state and emits account created event`() = runTest {
|
fun `given personalisation enabled, when registering account, then updates state and emits account created event`() = runTest {
|
||||||
fakeVectorFeatures.givenPersonalisationEnabled()
|
fakeVectorFeatures.givenPersonalisationEnabled()
|
||||||
fakeVectorFeatures.givenLiveLocationSharingEnabled()
|
|
||||||
givenRegistrationResultFor(A_LOADABLE_REGISTER_ACTION, RegistrationResult.Success(fakeSession))
|
givenRegistrationResultFor(A_LOADABLE_REGISTER_ACTION, RegistrationResult.Success(fakeSession))
|
||||||
givenSuccessfullyCreatesAccount(A_HOMESERVER_CAPABILITIES)
|
givenSuccessfullyCreatesAccount(A_HOMESERVER_CAPABILITIES)
|
||||||
val test = viewModel.test()
|
val test = viewModel.test()
|
||||||
@ -247,7 +246,6 @@ class OnboardingViewModelTest {
|
|||||||
@Test
|
@Test
|
||||||
fun `given personalisation enabled and registration has started and has dummy step to do, when handling action, then ignores other steps and executes dummy`() = runTest {
|
fun `given personalisation enabled and registration has started and has dummy step to do, when handling action, then ignores other steps and executes dummy`() = runTest {
|
||||||
fakeVectorFeatures.givenPersonalisationEnabled()
|
fakeVectorFeatures.givenPersonalisationEnabled()
|
||||||
fakeVectorFeatures.givenLiveLocationSharingEnabled()
|
|
||||||
givenSuccessfulRegistrationForStartAndDummySteps(missingStages = listOf(Stage.Dummy(mandatory = true)))
|
givenSuccessfulRegistrationForStartAndDummySteps(missingStages = listOf(Stage.Dummy(mandatory = true)))
|
||||||
val test = viewModel.test()
|
val test = viewModel.test()
|
||||||
|
|
||||||
|
@ -26,8 +26,4 @@ class FakeVectorFeatures : VectorFeatures by spyk<DefaultVectorFeatures>() {
|
|||||||
fun givenPersonalisationEnabled() {
|
fun givenPersonalisationEnabled() {
|
||||||
every { isOnboardingPersonalizeEnabled() } returns true
|
every { isOnboardingPersonalizeEnabled() } returns true
|
||||||
}
|
}
|
||||||
|
|
||||||
fun givenLiveLocationSharingEnabled() {
|
|
||||||
every { isLiveLocationEnabled() } returns true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user