Skip to content
Snippets Groups Projects
Unverified Commit 140f4c4e authored by chris-cwa's avatar chris-cwa Committed by GitHub
Browse files

Wrong navigation in "Symptom-Erfassung" (EXPOSUREAPP-4703) #2210


* no pop up for no info on symptoms

* fixed test

Co-authored-by: default avatarRalf Gehrer <ralfgehrer@users.noreply.github.com>
parent 8202ae88
No related branches found
No related tags found
No related merge requests found
......@@ -49,7 +49,15 @@ class SubmissionSymptomIntroductionViewModel @AssistedInject constructor(
}
doSubmit()
}
Symptoms.Indication.NO_INFORMATION -> showCancelDialog.postValue(Unit)
Symptoms.Indication.NO_INFORMATION -> {
submissionRepository.currentSymptoms.update {
Symptoms(
startOfSymptoms = null,
symptomIndication = Symptoms.Indication.NO_INFORMATION
)
}
doSubmit()
}
}
}
}
......
......@@ -52,18 +52,6 @@ class SubmissionSymptomIntroductionViewModelTest : BaseTest() {
autoSubmission = autoSubmission
)
@Test
fun `symptom indication is not written to settings`() {
createViewModel().apply {
onPositiveSymptomIndication()
onNegativeSymptomIndication()
onNoInformationSymptomIndication()
onNextClicked()
}
verify(exactly = 0) { submissionRepository.currentSymptoms }
}
@Test
fun `positive symptom indication is forwarded using navigation arguments`() {
createViewModel().apply {
......@@ -95,15 +83,19 @@ class SubmissionSymptomIntroductionViewModelTest : BaseTest() {
}
@Test
fun `no information symptom indication leads to cancel dialog`() {
fun `no information symptom indication leads to submission`() {
createViewModel().apply {
onNoInformationSymptomIndication()
onNextClicked()
navigation.value shouldBe null
showCancelDialog.value shouldBe Unit
navigation.value shouldBe SubmissionSymptomIntroductionFragmentDirections
.actionSubmissionSymptomIntroductionFragmentToMainFragment()
currentSymptoms.value shouldBe Symptoms(
startOfSymptoms = null,
symptomIndication = Symptoms.Indication.NO_INFORMATION
)
}
verify(exactly = 0) { submissionRepository.currentSymptoms }
coVerify { autoSubmission.runSubmissionNow() }
}
@Test
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment