File tree Expand file tree Collapse file tree
main/kotlin/org/cru/godtools/ui/dashboard/tools
testDebug/kotlin/org/cru/godtools/ui/dashboard/tools Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,7 +22,9 @@ import dagger.assisted.AssistedFactory
2222import dagger.assisted.AssistedInject
2323import dagger.hilt.components.SingletonComponent
2424import java.util.Locale
25+ import kotlinx.coroutines.coroutineScope
2526import kotlinx.coroutines.flow.first
27+ import kotlinx.coroutines.launch
2628import org.ccci.gto.android.common.sync.SyncTracker
2729import org.cru.godtools.analytics.model.OpenAnalyticsActionEvent
2830import org.cru.godtools.analytics.model.OpenAnalyticsActionEvent.Companion.ACTION_OPEN_TOOL_DETAILS
@@ -197,7 +199,10 @@ class ToolsPresenter @AssistedInject internal constructor(
197199
198200 private fun SyncTracker.syncData (locale : Locale , force : Boolean = false) = launchSync {
199201 val country = settings.getCountrySettingFlow().first()
200- syncService.syncToolOrder(locale, country, force)
202+ coroutineScope {
203+ launch { syncService.syncFeaturedTools(locale, country, force) }
204+ launch { syncService.syncToolOrder(locale, country, force) }
205+ }
201206 }
202207
203208 @AssistedFactory
Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ class ToolsPresenterTest {
7373 }
7474 private val syncService: GodToolsSyncService = mockk {
7575 coEvery { syncToolOrder(any(), any(), any()) } coAnswers { toolOrderSync.receive() }
76+ coEvery { syncFeaturedTools(any(), any(), any()) } returns true
7677 }
7778 private val favoriteToolsBannerPresenter = FakeBannerPresenter <FavoriteToolsBannerPresenter .UiState >(null )
7879 private val featuredToolsFlowProducer: FeaturedToolsFlowProducer = mockk {
@@ -265,7 +266,10 @@ class ToolsPresenterTest {
265266 presenter.test {
266267 awaitInitialItem()
267268 toolOrderSync.send(true )
268- coVerifyAll { syncService.syncToolOrder(Locale .ENGLISH , " US" , false ) }
269+ coVerifyAll {
270+ syncService.syncToolOrder(Locale .ENGLISH , " US" , false )
271+ syncService.syncFeaturedTools(Locale .ENGLISH , " US" , false )
272+ }
269273 }
270274 }
271275
@@ -278,7 +282,10 @@ class ToolsPresenterTest {
278282 presenter.test {
279283 awaitInitialItem()
280284 toolOrderSync.send(true )
281- coVerifyAll { syncService.syncToolOrder(Locale .FRENCH , " US" , false ) }
285+ coVerifyAll {
286+ syncService.syncToolOrder(Locale .FRENCH , " US" , false )
287+ syncService.syncFeaturedTools(Locale .FRENCH , " US" , false )
288+ }
282289 }
283290 }
284291
You can’t perform that action at this time.
0 commit comments