test: Fix ViewThreadViewModel flakiness (#1099)
Some tests were assuming the uiState would transition from .Loading to .Success, without considering there might be a .LoadingThread intermediate step. Cater for that to prevent test flakes.
This commit is contained in:
parent
22309d0156
commit
8e22a4e557
|
@ -178,7 +178,7 @@ class ViewThreadViewModelTest {
|
|||
|
||||
do {
|
||||
item = awaitItem()
|
||||
} while (item is ThreadUiState.Loading)
|
||||
} while (item !is ThreadUiState.Success)
|
||||
|
||||
assertEquals(
|
||||
ThreadUiState.Success(
|
||||
|
@ -219,7 +219,7 @@ class ViewThreadViewModelTest {
|
|||
|
||||
do {
|
||||
item = awaitItem()
|
||||
} while (item is ThreadUiState.Loading)
|
||||
} while (item !is ThreadUiState.Success)
|
||||
|
||||
assertEquals(
|
||||
ThreadUiState.Success(
|
||||
|
@ -252,7 +252,7 @@ class ViewThreadViewModelTest {
|
|||
|
||||
do {
|
||||
item = awaitItem()
|
||||
} while (item is ThreadUiState.Loading)
|
||||
} while (item !is ThreadUiState.Error)
|
||||
|
||||
assertEquals(
|
||||
ThreadUiState.Error::class.java,
|
||||
|
@ -279,7 +279,7 @@ class ViewThreadViewModelTest {
|
|||
|
||||
do {
|
||||
item = awaitItem()
|
||||
} while (item is ThreadUiState.Loading)
|
||||
} while (item !is ThreadUiState.Error)
|
||||
|
||||
assertEquals(
|
||||
ThreadUiState.Error::class.java,
|
||||
|
|
Loading…
Reference in New Issue