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( ...@@ -49,7 +49,15 @@ class SubmissionSymptomIntroductionViewModel @AssistedInject constructor(
} }
doSubmit() 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() { ...@@ -52,18 +52,6 @@ class SubmissionSymptomIntroductionViewModelTest : BaseTest() {
autoSubmission = autoSubmission autoSubmission = autoSubmission
) )
@Test
fun `symptom indication is not written to settings`() {
createViewModel().apply {
onPositiveSymptomIndication()
onNegativeSymptomIndication()
onNoInformationSymptomIndication()
onNextClicked()
}
verify(exactly = 0) { submissionRepository.currentSymptoms }
}
@Test @Test
fun `positive symptom indication is forwarded using navigation arguments`() { fun `positive symptom indication is forwarded using navigation arguments`() {
createViewModel().apply { createViewModel().apply {
...@@ -95,15 +83,19 @@ class SubmissionSymptomIntroductionViewModelTest : BaseTest() { ...@@ -95,15 +83,19 @@ class SubmissionSymptomIntroductionViewModelTest : BaseTest() {
} }
@Test @Test
fun `no information symptom indication leads to cancel dialog`() { fun `no information symptom indication leads to submission`() {
createViewModel().apply { createViewModel().apply {
onNoInformationSymptomIndication() onNoInformationSymptomIndication()
onNextClicked() onNextClicked()
navigation.value shouldBe null navigation.value shouldBe SubmissionSymptomIntroductionFragmentDirections
showCancelDialog.value shouldBe Unit .actionSubmissionSymptomIntroductionFragmentToMainFragment()
currentSymptoms.value shouldBe Symptoms(
startOfSymptoms = null,
symptomIndication = Symptoms.Indication.NO_INFORMATION
)
} }
verify(exactly = 0) { submissionRepository.currentSymptoms } coVerify { autoSubmission.runSubmissionNow() }
} }
@Test @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