Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests in QuestionnaireViewModel pass when they should pass #1820

Closed
omarismail94 opened this issue Jan 23, 2023 · 0 comments · Fixed by #1827
Closed

Tests in QuestionnaireViewModel pass when they should pass #1820

omarismail94 opened this issue Jan 23, 2023 · 0 comments · Fixed by #1827
Assignees
Labels
effort:medium Medium effort - 3 to 5 days P1 High priority issue type:bug Something isn't working

Comments

@omarismail94
Copy link
Contributor

Our QuestionnaireViewModelTest is passing tests that should be failing (the worst kind).

The code is making a cast that should never succeed:

viewModel.questionnaireStateFlow.value as DisplayMode.EditMode

but that is being called inside viewModel.runViewModelBlocking, which seems to run after the test completes. The custom function runs on the main dispatcher, but that does not block the test from completing.

https://github.com/google/android-fhir/blob/master/datacapture/src/test/java/com/google/android/fhir/datacapture/QuestionnaireViewModelTest.kt#L4043-L4057

@omarismail94 omarismail94 self-assigned this Jan 23, 2023
@PallaviGanorkar PallaviGanorkar added type:bug Something isn't working P1 High priority issue effort:medium Medium effort - 3 to 5 days labels Jan 25, 2023
@github-project-automation github-project-automation bot moved this from New to Complete in Android FHIR SDK Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort:medium Medium effort - 3 to 5 days P1 High priority issue type:bug Something isn't working
Projects
Status: Complete
Development

Successfully merging a pull request may close this issue.

2 participants