@@ -185,7 +185,7 @@ class LessonsPresenterTest {
185185 @Test
186186 fun `State - mode - personalization enabled` () = testScope.runTest {
187187 presenter.test {
188- val state = awaitItem()
188+ val state = awaitItemMatching { it.dataLoaded }
189189 assertEquals(UiState .Mode .PERSONALIZATION , state.mode)
190190
191191 state.eventSink(UiEvent .ChangeMode (UiState .Mode .ALL_LESSONS ))
@@ -437,7 +437,7 @@ class LessonsPresenterTest {
437437 @Test
438438 fun `SideEffect - RegisterSyncTask - Triggers initial sync` () = testScope.runTest {
439439 presenter.test {
440- awaitItem()
440+ awaitItemMatching { it.dataLoaded }
441441 toolOrderSync.send(true )
442442 coVerifyAll { syncService.syncToolOrder(Locale .ENGLISH , " US" , false ) }
443443 }
@@ -447,7 +447,7 @@ class LessonsPresenterTest {
447447 fun `SideEffect - RegisterSyncTask - uses locale from language filter` () = testScope.runTest {
448448 appLangFlow.value = Locale .FRENCH
449449 presenter.test {
450- awaitItem()
450+ awaitItemMatching { it.dataLoaded }
451451 toolOrderSync.send(true )
452452 coVerifyAll { syncService.syncToolOrder(Locale .FRENCH , " US" , false ) }
453453 }
@@ -471,7 +471,7 @@ class LessonsPresenterTest {
471471 @Test
472472 fun `SideEffect - RegisterSyncTask - passes force on triggered sync` () = testScope.runTest {
473473 presenter.test {
474- awaitItem()
474+ awaitItemMatching { it.dataLoaded }
475475 toolOrderSync.send(true )
476476 coVerify { syncService.syncToolOrder(Locale .ENGLISH , " US" , false ) }
477477
0 commit comments