Merge pull request #3044 from element-hq/feature/bma/testDefaultClearCacheUseCase

Add test on DefaultClearCacheUseCase
This commit is contained in:
Benoit Marty 2024-06-18 10:27:45 +02:00 committed by GitHub
commit 849f64f4aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 245 additions and 22 deletions

View file

@ -27,7 +27,8 @@ import kotlinx.coroutines.flow.MutableStateFlow
class FakeAnalyticsService(
isEnabled: Boolean = false,
didAskUserConsent: Boolean = false
didAskUserConsent: Boolean = false,
private val resetLambda: () -> Unit = {},
) : AnalyticsService {
private val isEnabledFlow = MutableStateFlow(isEnabled)
private val didAskUserConsentFlow = MutableStateFlow(didAskUserConsent)
@ -77,5 +78,6 @@ class FakeAnalyticsService(
override suspend fun reset() {
didAskUserConsentFlow.value = false
resetLambda()
}
}