Use backgroundScope
This commit is contained in:
parent
2a4726e611
commit
08673f44ce
3 changed files with 20 additions and 99 deletions
|
|
@ -15,18 +15,19 @@ import io.element.android.features.ftue.impl.state.DefaultFtueService
|
||||||
import io.element.android.features.ftue.impl.state.FtueStep
|
import io.element.android.features.ftue.impl.state.FtueStep
|
||||||
import io.element.android.features.lockscreen.api.LockScreenService
|
import io.element.android.features.lockscreen.api.LockScreenService
|
||||||
import io.element.android.features.lockscreen.test.FakeLockScreenService
|
import io.element.android.features.lockscreen.test.FakeLockScreenService
|
||||||
|
import io.element.android.libraries.matrix.api.verification.SessionVerificationService
|
||||||
import io.element.android.libraries.matrix.api.verification.SessionVerifiedStatus
|
import io.element.android.libraries.matrix.api.verification.SessionVerifiedStatus
|
||||||
import io.element.android.libraries.matrix.test.verification.FakeSessionVerificationService
|
import io.element.android.libraries.matrix.test.verification.FakeSessionVerificationService
|
||||||
|
import io.element.android.libraries.permissions.api.PermissionStateProvider
|
||||||
import io.element.android.libraries.permissions.impl.FakePermissionStateProvider
|
import io.element.android.libraries.permissions.impl.FakePermissionStateProvider
|
||||||
|
import io.element.android.libraries.preferences.api.store.SessionPreferencesStore
|
||||||
import io.element.android.libraries.preferences.test.InMemorySessionPreferencesStore
|
import io.element.android.libraries.preferences.test.InMemorySessionPreferencesStore
|
||||||
import io.element.android.services.analytics.api.AnalyticsService
|
import io.element.android.services.analytics.api.AnalyticsService
|
||||||
import io.element.android.services.analytics.test.FakeAnalyticsService
|
import io.element.android.services.analytics.test.FakeAnalyticsService
|
||||||
import io.element.android.services.toolbox.test.sdk.FakeBuildVersionSdkIntProvider
|
import io.element.android.services.toolbox.test.sdk.FakeBuildVersionSdkIntProvider
|
||||||
import io.element.android.tests.testutils.lambda.lambdaRecorder
|
import io.element.android.tests.testutils.lambda.lambdaRecorder
|
||||||
import io.element.android.tests.testutils.lambda.value
|
import io.element.android.tests.testutils.lambda.value
|
||||||
import kotlinx.coroutines.CoroutineScope
|
import kotlinx.coroutines.test.TestScope
|
||||||
import kotlinx.coroutines.SupervisorJob
|
|
||||||
import kotlinx.coroutines.cancel
|
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
|
|
@ -36,8 +37,9 @@ class DefaultFtueServiceTest {
|
||||||
val sessionVerificationService = FakeSessionVerificationService().apply {
|
val sessionVerificationService = FakeSessionVerificationService().apply {
|
||||||
givenVerifiedStatus(SessionVerifiedStatus.Unknown)
|
givenVerifiedStatus(SessionVerifiedStatus.Unknown)
|
||||||
}
|
}
|
||||||
val coroutineScope = CoroutineScope(coroutineContext + SupervisorJob())
|
val service = createDefaultFtueService(
|
||||||
val service = createDefaultFtueService(coroutineScope, sessionVerificationService)
|
sessionVerificationService = sessionVerificationService,
|
||||||
|
)
|
||||||
|
|
||||||
service.state.test {
|
service.state.test {
|
||||||
// Verification state is unknown, we don't display the flow yet
|
// Verification state is unknown, we don't display the flow yet
|
||||||
|
|
@ -47,9 +49,6 @@ class DefaultFtueServiceTest {
|
||||||
sessionVerificationService.givenVerifiedStatus(SessionVerifiedStatus.NotVerified)
|
sessionVerificationService.givenVerifiedStatus(SessionVerifiedStatus.NotVerified)
|
||||||
assertThat(awaitItem()).isEqualTo(FtueState.Incomplete)
|
assertThat(awaitItem()).isEqualTo(FtueState.Incomplete)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Cleanup
|
|
||||||
coroutineScope.cancel()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
@ -58,10 +57,7 @@ class DefaultFtueServiceTest {
|
||||||
val sessionVerificationService = FakeSessionVerificationService()
|
val sessionVerificationService = FakeSessionVerificationService()
|
||||||
val permissionStateProvider = FakePermissionStateProvider(permissionGranted = true)
|
val permissionStateProvider = FakePermissionStateProvider(permissionGranted = true)
|
||||||
val lockScreenService = FakeLockScreenService()
|
val lockScreenService = FakeLockScreenService()
|
||||||
val coroutineScope = CoroutineScope(coroutineContext + SupervisorJob())
|
|
||||||
|
|
||||||
val service = createDefaultFtueService(
|
val service = createDefaultFtueService(
|
||||||
coroutineScope = coroutineScope,
|
|
||||||
sessionVerificationService = sessionVerificationService,
|
sessionVerificationService = sessionVerificationService,
|
||||||
analyticsService = analyticsService,
|
analyticsService = analyticsService,
|
||||||
permissionStateProvider = permissionStateProvider,
|
permissionStateProvider = permissionStateProvider,
|
||||||
|
|
@ -75,9 +71,6 @@ class DefaultFtueServiceTest {
|
||||||
service.updateState()
|
service.updateState()
|
||||||
|
|
||||||
assertThat(service.state.value).isEqualTo(FtueState.Complete)
|
assertThat(service.state.value).isEqualTo(FtueState.Complete)
|
||||||
|
|
||||||
// Cleanup
|
|
||||||
coroutineScope.cancel()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
@ -88,10 +81,7 @@ class DefaultFtueServiceTest {
|
||||||
val analyticsService = FakeAnalyticsService()
|
val analyticsService = FakeAnalyticsService()
|
||||||
val permissionStateProvider = FakePermissionStateProvider(permissionGranted = false)
|
val permissionStateProvider = FakePermissionStateProvider(permissionGranted = false)
|
||||||
val lockScreenService = FakeLockScreenService()
|
val lockScreenService = FakeLockScreenService()
|
||||||
val coroutineScope = CoroutineScope(coroutineContext + SupervisorJob())
|
|
||||||
|
|
||||||
val service = createDefaultFtueService(
|
val service = createDefaultFtueService(
|
||||||
coroutineScope = coroutineScope,
|
|
||||||
sessionVerificationService = sessionVerificationService,
|
sessionVerificationService = sessionVerificationService,
|
||||||
analyticsService = analyticsService,
|
analyticsService = analyticsService,
|
||||||
permissionStateProvider = permissionStateProvider,
|
permissionStateProvider = permissionStateProvider,
|
||||||
|
|
@ -126,20 +116,15 @@ class DefaultFtueServiceTest {
|
||||||
// Final state
|
// Final state
|
||||||
null,
|
null,
|
||||||
)
|
)
|
||||||
|
|
||||||
// Cleanup
|
|
||||||
coroutineScope.cancel()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `if a check for a step is true, start from the next one`() = runTest {
|
fun `if a check for a step is true, start from the next one`() = runTest {
|
||||||
val coroutineScope = CoroutineScope(coroutineContext + SupervisorJob())
|
|
||||||
val sessionVerificationService = FakeSessionVerificationService()
|
val sessionVerificationService = FakeSessionVerificationService()
|
||||||
val analyticsService = FakeAnalyticsService()
|
val analyticsService = FakeAnalyticsService()
|
||||||
val permissionStateProvider = FakePermissionStateProvider(permissionGranted = false)
|
val permissionStateProvider = FakePermissionStateProvider(permissionGranted = false)
|
||||||
val lockScreenService = FakeLockScreenService()
|
val lockScreenService = FakeLockScreenService()
|
||||||
val service = createDefaultFtueService(
|
val service = createDefaultFtueService(
|
||||||
coroutineScope = coroutineScope,
|
|
||||||
sessionVerificationService = sessionVerificationService,
|
sessionVerificationService = sessionVerificationService,
|
||||||
analyticsService = analyticsService,
|
analyticsService = analyticsService,
|
||||||
permissionStateProvider = permissionStateProvider,
|
permissionStateProvider = permissionStateProvider,
|
||||||
|
|
@ -155,14 +140,10 @@ class DefaultFtueServiceTest {
|
||||||
|
|
||||||
analyticsService.setDidAskUserConsent()
|
analyticsService.setDidAskUserConsent()
|
||||||
assertThat(service.getNextStep(null)).isNull()
|
assertThat(service.getNextStep(null)).isNull()
|
||||||
|
|
||||||
// Cleanup
|
|
||||||
coroutineScope.cancel()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `if version is older than 13 we don't display the notification opt in screen`() = runTest {
|
fun `if version is older than 13 we don't display the notification opt in screen`() = runTest {
|
||||||
val coroutineScope = CoroutineScope(coroutineContext + SupervisorJob())
|
|
||||||
val sessionVerificationService = FakeSessionVerificationService()
|
val sessionVerificationService = FakeSessionVerificationService()
|
||||||
val analyticsService = FakeAnalyticsService()
|
val analyticsService = FakeAnalyticsService()
|
||||||
val lockScreenService = FakeLockScreenService()
|
val lockScreenService = FakeLockScreenService()
|
||||||
|
|
@ -170,7 +151,6 @@ class DefaultFtueServiceTest {
|
||||||
val service = createDefaultFtueService(
|
val service = createDefaultFtueService(
|
||||||
sdkIntVersion = Build.VERSION_CODES.M,
|
sdkIntVersion = Build.VERSION_CODES.M,
|
||||||
sessionVerificationService = sessionVerificationService,
|
sessionVerificationService = sessionVerificationService,
|
||||||
coroutineScope = coroutineScope,
|
|
||||||
analyticsService = analyticsService,
|
analyticsService = analyticsService,
|
||||||
lockScreenService = lockScreenService,
|
lockScreenService = lockScreenService,
|
||||||
)
|
)
|
||||||
|
|
@ -182,14 +162,10 @@ class DefaultFtueServiceTest {
|
||||||
|
|
||||||
analyticsService.setDidAskUserConsent()
|
analyticsService.setDidAskUserConsent()
|
||||||
assertThat(service.getNextStep(null)).isNull()
|
assertThat(service.getNextStep(null)).isNull()
|
||||||
|
|
||||||
// Cleanup
|
|
||||||
coroutineScope.cancel()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `reset do the expected actions S`() = runTest {
|
fun `reset do the expected actions S`() = runTest {
|
||||||
val coroutineScope = CoroutineScope(coroutineContext + SupervisorJob())
|
|
||||||
val resetAnalyticsLambda = lambdaRecorder<Unit> { }
|
val resetAnalyticsLambda = lambdaRecorder<Unit> { }
|
||||||
val analyticsService = FakeAnalyticsService(
|
val analyticsService = FakeAnalyticsService(
|
||||||
resetLambda = resetAnalyticsLambda
|
resetLambda = resetAnalyticsLambda
|
||||||
|
|
@ -199,7 +175,6 @@ class DefaultFtueServiceTest {
|
||||||
resetPermissionLambda = resetPermissionLambda
|
resetPermissionLambda = resetPermissionLambda
|
||||||
)
|
)
|
||||||
val service = createDefaultFtueService(
|
val service = createDefaultFtueService(
|
||||||
coroutineScope = coroutineScope,
|
|
||||||
sdkIntVersion = Build.VERSION_CODES.S,
|
sdkIntVersion = Build.VERSION_CODES.S,
|
||||||
permissionStateProvider = permissionStateProvider,
|
permissionStateProvider = permissionStateProvider,
|
||||||
analyticsService = analyticsService,
|
analyticsService = analyticsService,
|
||||||
|
|
@ -211,7 +186,6 @@ class DefaultFtueServiceTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `reset do the expected actions TIRAMISU`() = runTest {
|
fun `reset do the expected actions TIRAMISU`() = runTest {
|
||||||
val coroutineScope = CoroutineScope(coroutineContext + SupervisorJob())
|
|
||||||
val resetLambda = lambdaRecorder<Unit> { }
|
val resetLambda = lambdaRecorder<Unit> { }
|
||||||
val analyticsService = FakeAnalyticsService(
|
val analyticsService = FakeAnalyticsService(
|
||||||
resetLambda = resetLambda
|
resetLambda = resetLambda
|
||||||
|
|
@ -221,7 +195,6 @@ class DefaultFtueServiceTest {
|
||||||
resetPermissionLambda = resetPermissionLambda
|
resetPermissionLambda = resetPermissionLambda
|
||||||
)
|
)
|
||||||
val service = createDefaultFtueService(
|
val service = createDefaultFtueService(
|
||||||
coroutineScope = coroutineScope,
|
|
||||||
sdkIntVersion = Build.VERSION_CODES.TIRAMISU,
|
sdkIntVersion = Build.VERSION_CODES.TIRAMISU,
|
||||||
permissionStateProvider = permissionStateProvider,
|
permissionStateProvider = permissionStateProvider,
|
||||||
analyticsService = analyticsService,
|
analyticsService = analyticsService,
|
||||||
|
|
@ -232,17 +205,16 @@ class DefaultFtueServiceTest {
|
||||||
.with(value("android.permission.POST_NOTIFICATIONS"))
|
.with(value("android.permission.POST_NOTIFICATIONS"))
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createDefaultFtueService(
|
private fun TestScope.createDefaultFtueService(
|
||||||
coroutineScope: CoroutineScope,
|
sessionVerificationService: SessionVerificationService = FakeSessionVerificationService(),
|
||||||
sessionVerificationService: FakeSessionVerificationService = FakeSessionVerificationService(),
|
|
||||||
analyticsService: AnalyticsService = FakeAnalyticsService(),
|
analyticsService: AnalyticsService = FakeAnalyticsService(),
|
||||||
permissionStateProvider: FakePermissionStateProvider = FakePermissionStateProvider(permissionGranted = false),
|
permissionStateProvider: PermissionStateProvider = FakePermissionStateProvider(permissionGranted = false),
|
||||||
lockScreenService: LockScreenService = FakeLockScreenService(),
|
lockScreenService: LockScreenService = FakeLockScreenService(),
|
||||||
sessionPreferencesStore: InMemorySessionPreferencesStore = InMemorySessionPreferencesStore(),
|
sessionPreferencesStore: SessionPreferencesStore = InMemorySessionPreferencesStore(),
|
||||||
// First version where notification permission is required
|
// First version where notification permission is required
|
||||||
sdkIntVersion: Int = Build.VERSION_CODES.TIRAMISU,
|
sdkIntVersion: Int = Build.VERSION_CODES.TIRAMISU,
|
||||||
) = DefaultFtueService(
|
) = DefaultFtueService(
|
||||||
sessionCoroutineScope = coroutineScope,
|
sessionCoroutineScope = backgroundScope,
|
||||||
sessionVerificationService = sessionVerificationService,
|
sessionVerificationService = sessionVerificationService,
|
||||||
sdkVersionProvider = FakeBuildVersionSdkIntProvider(sdkIntVersion),
|
sdkVersionProvider = FakeBuildVersionSdkIntProvider(sdkIntVersion),
|
||||||
analyticsService = analyticsService,
|
analyticsService = analyticsService,
|
||||||
|
|
|
||||||
|
|
@ -82,10 +82,7 @@ import io.element.android.tests.testutils.lambda.lambdaRecorder
|
||||||
import io.element.android.tests.testutils.lambda.value
|
import io.element.android.tests.testutils.lambda.value
|
||||||
import io.element.android.tests.testutils.test
|
import io.element.android.tests.testutils.test
|
||||||
import io.element.android.tests.testutils.testCoroutineDispatchers
|
import io.element.android.tests.testutils.testCoroutineDispatchers
|
||||||
import kotlinx.coroutines.CoroutineScope
|
|
||||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||||
import kotlinx.coroutines.SupervisorJob
|
|
||||||
import kotlinx.coroutines.cancel
|
|
||||||
import kotlinx.coroutines.flow.MutableStateFlow
|
import kotlinx.coroutines.flow.MutableStateFlow
|
||||||
import kotlinx.coroutines.test.TestScope
|
import kotlinx.coroutines.test.TestScope
|
||||||
import kotlinx.coroutines.test.advanceTimeBy
|
import kotlinx.coroutines.test.advanceTimeBy
|
||||||
|
|
@ -100,7 +97,6 @@ class RoomListPresenterTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `present - should start with no user and then load user with success`() = runTest {
|
fun `present - should start with no user and then load user with success`() = runTest {
|
||||||
val scope = CoroutineScope(coroutineContext + SupervisorJob())
|
|
||||||
val matrixClient = FakeMatrixClient(
|
val matrixClient = FakeMatrixClient(
|
||||||
userDisplayName = null,
|
userDisplayName = null,
|
||||||
userAvatarUrl = null,
|
userAvatarUrl = null,
|
||||||
|
|
@ -108,7 +104,6 @@ class RoomListPresenterTest {
|
||||||
matrixClient.givenGetProfileResult(matrixClient.sessionId, Result.success(MatrixUser(matrixClient.sessionId, A_USER_NAME, AN_AVATAR_URL)))
|
matrixClient.givenGetProfileResult(matrixClient.sessionId, Result.success(MatrixUser(matrixClient.sessionId, A_USER_NAME, AN_AVATAR_URL)))
|
||||||
val presenter = createRoomListPresenter(
|
val presenter = createRoomListPresenter(
|
||||||
client = matrixClient,
|
client = matrixClient,
|
||||||
coroutineScope = scope,
|
|
||||||
)
|
)
|
||||||
moleculeFlow(RecompositionMode.Immediate) {
|
moleculeFlow(RecompositionMode.Immediate) {
|
||||||
presenter.present()
|
presenter.present()
|
||||||
|
|
@ -120,13 +115,11 @@ class RoomListPresenterTest {
|
||||||
assertThat(withUserState.matrixUser.displayName).isEqualTo(A_USER_NAME)
|
assertThat(withUserState.matrixUser.displayName).isEqualTo(A_USER_NAME)
|
||||||
assertThat(withUserState.matrixUser.avatarUrl).isEqualTo(AN_AVATAR_URL)
|
assertThat(withUserState.matrixUser.avatarUrl).isEqualTo(AN_AVATAR_URL)
|
||||||
assertThat(withUserState.showAvatarIndicator).isTrue()
|
assertThat(withUserState.showAvatarIndicator).isTrue()
|
||||||
scope.cancel()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `present - show avatar indicator`() = runTest {
|
fun `present - show avatar indicator`() = runTest {
|
||||||
val scope = CoroutineScope(coroutineContext + SupervisorJob())
|
|
||||||
val encryptionService = FakeEncryptionService()
|
val encryptionService = FakeEncryptionService()
|
||||||
val sessionVerificationService = FakeSessionVerificationService()
|
val sessionVerificationService = FakeSessionVerificationService()
|
||||||
val matrixClient = FakeMatrixClient(
|
val matrixClient = FakeMatrixClient(
|
||||||
|
|
@ -135,7 +128,6 @@ class RoomListPresenterTest {
|
||||||
)
|
)
|
||||||
val presenter = createRoomListPresenter(
|
val presenter = createRoomListPresenter(
|
||||||
client = matrixClient,
|
client = matrixClient,
|
||||||
coroutineScope = scope
|
|
||||||
)
|
)
|
||||||
moleculeFlow(RecompositionMode.Immediate) {
|
moleculeFlow(RecompositionMode.Immediate) {
|
||||||
presenter.present()
|
presenter.present()
|
||||||
|
|
@ -146,7 +138,6 @@ class RoomListPresenterTest {
|
||||||
encryptionService.emitBackupState(BackupState.ENABLED)
|
encryptionService.emitBackupState(BackupState.ENABLED)
|
||||||
val finalState = awaitItem()
|
val finalState = awaitItem()
|
||||||
assertThat(finalState.showAvatarIndicator).isFalse()
|
assertThat(finalState.showAvatarIndicator).isFalse()
|
||||||
scope.cancel()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -157,8 +148,7 @@ class RoomListPresenterTest {
|
||||||
userAvatarUrl = null,
|
userAvatarUrl = null,
|
||||||
)
|
)
|
||||||
matrixClient.givenGetProfileResult(matrixClient.sessionId, Result.failure(AN_EXCEPTION))
|
matrixClient.givenGetProfileResult(matrixClient.sessionId, Result.failure(AN_EXCEPTION))
|
||||||
val scope = CoroutineScope(coroutineContext + SupervisorJob())
|
val presenter = createRoomListPresenter(client = matrixClient)
|
||||||
val presenter = createRoomListPresenter(client = matrixClient, coroutineScope = scope)
|
|
||||||
moleculeFlow(RecompositionMode.Immediate) {
|
moleculeFlow(RecompositionMode.Immediate) {
|
||||||
presenter.present()
|
presenter.present()
|
||||||
}.test {
|
}.test {
|
||||||
|
|
@ -174,8 +164,7 @@ class RoomListPresenterTest {
|
||||||
val matrixClient = FakeMatrixClient(
|
val matrixClient = FakeMatrixClient(
|
||||||
roomListService = roomListService
|
roomListService = roomListService
|
||||||
)
|
)
|
||||||
val scope = CoroutineScope(coroutineContext + SupervisorJob())
|
val presenter = createRoomListPresenter(client = matrixClient)
|
||||||
val presenter = createRoomListPresenter(client = matrixClient, coroutineScope = scope)
|
|
||||||
moleculeFlow(RecompositionMode.Immediate) {
|
moleculeFlow(RecompositionMode.Immediate) {
|
||||||
presenter.present()
|
presenter.present()
|
||||||
}.test {
|
}.test {
|
||||||
|
|
@ -200,13 +189,11 @@ class RoomListPresenterTest {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
cancelAndIgnoreRemainingEvents()
|
cancelAndIgnoreRemainingEvents()
|
||||||
scope.cancel()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `present - handle DismissRequestVerificationPrompt`() = runTest {
|
fun `present - handle DismissRequestVerificationPrompt`() = runTest {
|
||||||
val scope = CoroutineScope(context = coroutineContext + SupervisorJob())
|
|
||||||
val roomListService = FakeRoomListService().apply {
|
val roomListService = FakeRoomListService().apply {
|
||||||
postAllRoomsLoadingState(RoomList.LoadingState.Loaded(1))
|
postAllRoomsLoadingState(RoomList.LoadingState.Loaded(1))
|
||||||
}
|
}
|
||||||
|
|
@ -216,7 +203,6 @@ class RoomListPresenterTest {
|
||||||
val syncService = FakeSyncService(MutableStateFlow(SyncState.Running))
|
val syncService = FakeSyncService(MutableStateFlow(SyncState.Running))
|
||||||
val presenter = createRoomListPresenter(
|
val presenter = createRoomListPresenter(
|
||||||
client = FakeMatrixClient(roomListService = roomListService, encryptionService = encryptionService, syncService = syncService),
|
client = FakeMatrixClient(roomListService = roomListService, encryptionService = encryptionService, syncService = syncService),
|
||||||
coroutineScope = scope,
|
|
||||||
)
|
)
|
||||||
moleculeFlow(RecompositionMode.Immediate) {
|
moleculeFlow(RecompositionMode.Immediate) {
|
||||||
presenter.present()
|
presenter.present()
|
||||||
|
|
@ -228,7 +214,6 @@ class RoomListPresenterTest {
|
||||||
assertThat(eventWithContentAsRooms.contentAsRooms().securityBannerState).isEqualTo(SecurityBannerState.RecoveryKeyConfirmation)
|
assertThat(eventWithContentAsRooms.contentAsRooms().securityBannerState).isEqualTo(SecurityBannerState.RecoveryKeyConfirmation)
|
||||||
eventSink(RoomListEvents.DismissRequestVerificationPrompt)
|
eventSink(RoomListEvents.DismissRequestVerificationPrompt)
|
||||||
assertThat(awaitItem().contentAsRooms().securityBannerState).isEqualTo(SecurityBannerState.None)
|
assertThat(awaitItem().contentAsRooms().securityBannerState).isEqualTo(SecurityBannerState.None)
|
||||||
scope.cancel()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -248,10 +233,8 @@ class RoomListPresenterTest {
|
||||||
},
|
},
|
||||||
syncService = FakeSyncService(MutableStateFlow(SyncState.Running)),
|
syncService = FakeSyncService(MutableStateFlow(SyncState.Running)),
|
||||||
)
|
)
|
||||||
val scope = CoroutineScope(context = coroutineContext + SupervisorJob())
|
|
||||||
val presenter = createRoomListPresenter(
|
val presenter = createRoomListPresenter(
|
||||||
client = matrixClient,
|
client = matrixClient,
|
||||||
coroutineScope = scope,
|
|
||||||
)
|
)
|
||||||
moleculeFlow(RecompositionMode.Immediate) {
|
moleculeFlow(RecompositionMode.Immediate) {
|
||||||
presenter.present()
|
presenter.present()
|
||||||
|
|
@ -277,18 +260,16 @@ class RoomListPresenterTest {
|
||||||
nextState.eventSink(RoomListEvents.DismissBanner)
|
nextState.eventSink(RoomListEvents.DismissBanner)
|
||||||
val finalState = awaitItem()
|
val finalState = awaitItem()
|
||||||
assertThat(finalState.contentAsRooms().securityBannerState).isEqualTo(SecurityBannerState.None)
|
assertThat(finalState.contentAsRooms().securityBannerState).isEqualTo(SecurityBannerState.None)
|
||||||
scope.cancel()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `present - show context menu`() = runTest {
|
fun `present - show context menu`() = runTest {
|
||||||
val scope = CoroutineScope(coroutineContext + SupervisorJob())
|
|
||||||
val room = FakeMatrixRoom()
|
val room = FakeMatrixRoom()
|
||||||
val client = FakeMatrixClient().apply {
|
val client = FakeMatrixClient().apply {
|
||||||
givenGetRoomResult(A_ROOM_ID, room)
|
givenGetRoomResult(A_ROOM_ID, room)
|
||||||
}
|
}
|
||||||
val presenter = createRoomListPresenter(client = client, coroutineScope = scope)
|
val presenter = createRoomListPresenter(client = client)
|
||||||
moleculeFlow(RecompositionMode.Immediate) {
|
moleculeFlow(RecompositionMode.Immediate) {
|
||||||
presenter.present()
|
presenter.present()
|
||||||
}.test {
|
}.test {
|
||||||
|
|
@ -326,18 +307,16 @@ class RoomListPresenterTest {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
scope.cancel()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `present - hide context menu`() = runTest {
|
fun `present - hide context menu`() = runTest {
|
||||||
val scope = CoroutineScope(coroutineContext + SupervisorJob())
|
|
||||||
val room = FakeMatrixRoom()
|
val room = FakeMatrixRoom()
|
||||||
val client = FakeMatrixClient().apply {
|
val client = FakeMatrixClient().apply {
|
||||||
givenGetRoomResult(A_ROOM_ID, room)
|
givenGetRoomResult(A_ROOM_ID, room)
|
||||||
}
|
}
|
||||||
val presenter = createRoomListPresenter(client = client, coroutineScope = scope)
|
val presenter = createRoomListPresenter(client = client)
|
||||||
moleculeFlow(RecompositionMode.Immediate) {
|
moleculeFlow(RecompositionMode.Immediate) {
|
||||||
presenter.present()
|
presenter.present()
|
||||||
}.test {
|
}.test {
|
||||||
|
|
@ -362,17 +341,14 @@ class RoomListPresenterTest {
|
||||||
|
|
||||||
val hiddenState = awaitItem()
|
val hiddenState = awaitItem()
|
||||||
assertThat(hiddenState.contextMenu).isEqualTo(RoomListState.ContextMenu.Hidden)
|
assertThat(hiddenState.contextMenu).isEqualTo(RoomListState.ContextMenu.Hidden)
|
||||||
scope.cancel()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `present - leave room calls into leave room presenter`() = runTest {
|
fun `present - leave room calls into leave room presenter`() = runTest {
|
||||||
val leaveRoomEventsRecorder = EventsRecorder<LeaveRoomEvent>()
|
val leaveRoomEventsRecorder = EventsRecorder<LeaveRoomEvent>()
|
||||||
val scope = CoroutineScope(coroutineContext + SupervisorJob())
|
|
||||||
val presenter = createRoomListPresenter(
|
val presenter = createRoomListPresenter(
|
||||||
leaveRoomState = aLeaveRoomState(eventSink = leaveRoomEventsRecorder),
|
leaveRoomState = aLeaveRoomState(eventSink = leaveRoomEventsRecorder),
|
||||||
coroutineScope = scope,
|
|
||||||
)
|
)
|
||||||
moleculeFlow(RecompositionMode.Immediate) {
|
moleculeFlow(RecompositionMode.Immediate) {
|
||||||
presenter.present()
|
presenter.present()
|
||||||
|
|
@ -381,7 +357,6 @@ class RoomListPresenterTest {
|
||||||
initialState.eventSink(RoomListEvents.LeaveRoom(A_ROOM_ID))
|
initialState.eventSink(RoomListEvents.LeaveRoom(A_ROOM_ID))
|
||||||
leaveRoomEventsRecorder.assertSingle(LeaveRoomEvent.ShowConfirmation(A_ROOM_ID))
|
leaveRoomEventsRecorder.assertSingle(LeaveRoomEvent.ShowConfirmation(A_ROOM_ID))
|
||||||
cancelAndIgnoreRemainingEvents()
|
cancelAndIgnoreRemainingEvents()
|
||||||
scope.cancel()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -393,9 +368,7 @@ class RoomListPresenterTest {
|
||||||
eventSink = eventRecorder
|
eventSink = eventRecorder
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
val scope = CoroutineScope(coroutineContext + SupervisorJob())
|
|
||||||
val presenter = createRoomListPresenter(
|
val presenter = createRoomListPresenter(
|
||||||
coroutineScope = scope,
|
|
||||||
searchPresenter = searchPresenter,
|
searchPresenter = searchPresenter,
|
||||||
)
|
)
|
||||||
moleculeFlow(RecompositionMode.Immediate) {
|
moleculeFlow(RecompositionMode.Immediate) {
|
||||||
|
|
@ -414,7 +387,6 @@ class RoomListPresenterTest {
|
||||||
RoomListSearchEvents.ToggleSearchVisibility
|
RoomListSearchEvents.ToggleSearchVisibility
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
scope.cancel()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -429,8 +401,7 @@ class RoomListPresenterTest {
|
||||||
roomListService = roomListService,
|
roomListService = roomListService,
|
||||||
notificationSettingsService = notificationSettingsService
|
notificationSettingsService = notificationSettingsService
|
||||||
)
|
)
|
||||||
val scope = CoroutineScope(coroutineContext + SupervisorJob())
|
val presenter = createRoomListPresenter(client = matrixClient)
|
||||||
val presenter = createRoomListPresenter(client = matrixClient, coroutineScope = scope)
|
|
||||||
moleculeFlow(RecompositionMode.Immediate) {
|
moleculeFlow(RecompositionMode.Immediate) {
|
||||||
presenter.present()
|
presenter.present()
|
||||||
}.test {
|
}.test {
|
||||||
|
|
@ -444,13 +415,11 @@ class RoomListPresenterTest {
|
||||||
val room = updatedState.contentAsRooms().summaries.find { it.id == A_ROOM_ID.value }
|
val room = updatedState.contentAsRooms().summaries.find { it.id == A_ROOM_ID.value }
|
||||||
assertThat(room?.userDefinedNotificationMode).isEqualTo(userDefinedMode)
|
assertThat(room?.userDefinedNotificationMode).isEqualTo(userDefinedMode)
|
||||||
cancelAndIgnoreRemainingEvents()
|
cancelAndIgnoreRemainingEvents()
|
||||||
scope.cancel()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `present - when set is favorite event is emitted, then the action is called`() = runTest {
|
fun `present - when set is favorite event is emitted, then the action is called`() = runTest {
|
||||||
val scope = CoroutineScope(coroutineContext + SupervisorJob())
|
|
||||||
val setIsFavoriteResult = lambdaRecorder { _: Boolean -> Result.success(Unit) }
|
val setIsFavoriteResult = lambdaRecorder { _: Boolean -> Result.success(Unit) }
|
||||||
val room = FakeMatrixRoom(
|
val room = FakeMatrixRoom(
|
||||||
setIsFavoriteResult = setIsFavoriteResult
|
setIsFavoriteResult = setIsFavoriteResult
|
||||||
|
|
@ -459,7 +428,7 @@ class RoomListPresenterTest {
|
||||||
val client = FakeMatrixClient().apply {
|
val client = FakeMatrixClient().apply {
|
||||||
givenGetRoomResult(A_ROOM_ID, room)
|
givenGetRoomResult(A_ROOM_ID, room)
|
||||||
}
|
}
|
||||||
val presenter = createRoomListPresenter(client = client, coroutineScope = scope, analyticsService = analyticsService)
|
val presenter = createRoomListPresenter(client = client, analyticsService = analyticsService)
|
||||||
moleculeFlow(RecompositionMode.Immediate) {
|
moleculeFlow(RecompositionMode.Immediate) {
|
||||||
presenter.present()
|
presenter.present()
|
||||||
}.test {
|
}.test {
|
||||||
|
|
@ -477,13 +446,11 @@ class RoomListPresenterTest {
|
||||||
Interaction(name = Interaction.Name.MobileRoomListRoomContextMenuFavouriteToggle)
|
Interaction(name = Interaction.Name.MobileRoomListRoomContextMenuFavouriteToggle)
|
||||||
)
|
)
|
||||||
cancelAndIgnoreRemainingEvents()
|
cancelAndIgnoreRemainingEvents()
|
||||||
scope.cancel()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `present - when room service returns no room, then contentState is Empty`() = runTest {
|
fun `present - when room service returns no room, then contentState is Empty`() = runTest {
|
||||||
val scope = CoroutineScope(coroutineContext + SupervisorJob())
|
|
||||||
val roomListService = FakeRoomListService()
|
val roomListService = FakeRoomListService()
|
||||||
roomListService.postAllRoomsLoadingState(RoomList.LoadingState.Loaded(0))
|
roomListService.postAllRoomsLoadingState(RoomList.LoadingState.Loaded(0))
|
||||||
val matrixClient = FakeMatrixClient(
|
val matrixClient = FakeMatrixClient(
|
||||||
|
|
@ -491,13 +458,11 @@ class RoomListPresenterTest {
|
||||||
)
|
)
|
||||||
val presenter = createRoomListPresenter(
|
val presenter = createRoomListPresenter(
|
||||||
client = matrixClient,
|
client = matrixClient,
|
||||||
coroutineScope = scope,
|
|
||||||
)
|
)
|
||||||
moleculeFlow(RecompositionMode.Immediate) {
|
moleculeFlow(RecompositionMode.Immediate) {
|
||||||
presenter.present()
|
presenter.present()
|
||||||
}.test {
|
}.test {
|
||||||
assertThat(awaitItem().contentState).isInstanceOf(RoomListContentState.Empty::class.java)
|
assertThat(awaitItem().contentState).isInstanceOf(RoomListContentState.Empty::class.java)
|
||||||
scope.cancel()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -514,14 +479,12 @@ class RoomListPresenterTest {
|
||||||
givenGetRoomResult(A_ROOM_ID_3, room3)
|
givenGetRoomResult(A_ROOM_ID_3, room3)
|
||||||
}
|
}
|
||||||
val analyticsService = FakeAnalyticsService()
|
val analyticsService = FakeAnalyticsService()
|
||||||
val scope = CoroutineScope(coroutineContext + SupervisorJob())
|
|
||||||
val clearMessagesForRoomLambda = lambdaRecorder<SessionId, RoomId, Unit> { _, _ -> }
|
val clearMessagesForRoomLambda = lambdaRecorder<SessionId, RoomId, Unit> { _, _ -> }
|
||||||
val notificationCleaner = FakeNotificationCleaner(
|
val notificationCleaner = FakeNotificationCleaner(
|
||||||
clearMessagesForRoomLambda = clearMessagesForRoomLambda,
|
clearMessagesForRoomLambda = clearMessagesForRoomLambda,
|
||||||
)
|
)
|
||||||
val presenter = createRoomListPresenter(
|
val presenter = createRoomListPresenter(
|
||||||
client = matrixClient,
|
client = matrixClient,
|
||||||
coroutineScope = scope,
|
|
||||||
sessionPreferencesStore = sessionPreferencesStore,
|
sessionPreferencesStore = sessionPreferencesStore,
|
||||||
analyticsService = analyticsService,
|
analyticsService = analyticsService,
|
||||||
notificationCleaner = notificationCleaner,
|
notificationCleaner = notificationCleaner,
|
||||||
|
|
@ -558,7 +521,6 @@ class RoomListPresenterTest {
|
||||||
Interaction(name = Interaction.Name.MobileRoomListRoomContextMenuUnreadToggle),
|
Interaction(name = Interaction.Name.MobileRoomListRoomContextMenuUnreadToggle),
|
||||||
)
|
)
|
||||||
cancelAndIgnoreRemainingEvents()
|
cancelAndIgnoreRemainingEvents()
|
||||||
scope.cancel()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -569,7 +531,6 @@ class RoomListPresenterTest {
|
||||||
anAcceptDeclineInviteState(eventSink = eventSinkRecorder)
|
anAcceptDeclineInviteState(eventSink = eventSinkRecorder)
|
||||||
}
|
}
|
||||||
val roomListService = FakeRoomListService()
|
val roomListService = FakeRoomListService()
|
||||||
val scope = CoroutineScope(coroutineContext + SupervisorJob())
|
|
||||||
val matrixClient = FakeMatrixClient(
|
val matrixClient = FakeMatrixClient(
|
||||||
roomListService = roomListService,
|
roomListService = roomListService,
|
||||||
)
|
)
|
||||||
|
|
@ -579,7 +540,6 @@ class RoomListPresenterTest {
|
||||||
roomListService.postAllRoomsLoadingState(RoomList.LoadingState.Loaded(1))
|
roomListService.postAllRoomsLoadingState(RoomList.LoadingState.Loaded(1))
|
||||||
roomListService.postAllRooms(listOf(roomSummary))
|
roomListService.postAllRooms(listOf(roomSummary))
|
||||||
val presenter = createRoomListPresenter(
|
val presenter = createRoomListPresenter(
|
||||||
coroutineScope = scope,
|
|
||||||
client = matrixClient,
|
client = matrixClient,
|
||||||
acceptDeclineInvitePresenter = acceptDeclinePresenter
|
acceptDeclineInvitePresenter = acceptDeclinePresenter
|
||||||
)
|
)
|
||||||
|
|
@ -610,7 +570,6 @@ class RoomListPresenterTest {
|
||||||
fun `present - UpdateVisibleRange will cancel the previous subscription if called too soon`() = runTest {
|
fun `present - UpdateVisibleRange will cancel the previous subscription if called too soon`() = runTest {
|
||||||
val subscribeToVisibleRoomsLambda = lambdaRecorder { _: List<RoomId> -> }
|
val subscribeToVisibleRoomsLambda = lambdaRecorder { _: List<RoomId> -> }
|
||||||
val roomListService = FakeRoomListService(subscribeToVisibleRoomsLambda = subscribeToVisibleRoomsLambda)
|
val roomListService = FakeRoomListService(subscribeToVisibleRoomsLambda = subscribeToVisibleRoomsLambda)
|
||||||
val scope = CoroutineScope(coroutineContext + SupervisorJob())
|
|
||||||
val matrixClient = FakeMatrixClient(
|
val matrixClient = FakeMatrixClient(
|
||||||
roomListService = roomListService,
|
roomListService = roomListService,
|
||||||
)
|
)
|
||||||
|
|
@ -620,7 +579,6 @@ class RoomListPresenterTest {
|
||||||
roomListService.postAllRoomsLoadingState(RoomList.LoadingState.Loaded(1))
|
roomListService.postAllRoomsLoadingState(RoomList.LoadingState.Loaded(1))
|
||||||
roomListService.postAllRooms(listOf(roomSummary))
|
roomListService.postAllRooms(listOf(roomSummary))
|
||||||
val presenter = createRoomListPresenter(
|
val presenter = createRoomListPresenter(
|
||||||
coroutineScope = scope,
|
|
||||||
client = matrixClient,
|
client = matrixClient,
|
||||||
)
|
)
|
||||||
presenter.test {
|
presenter.test {
|
||||||
|
|
@ -641,7 +599,6 @@ class RoomListPresenterTest {
|
||||||
fun `present - UpdateVisibleRange subscribes to rooms in visible range`() = runTest {
|
fun `present - UpdateVisibleRange subscribes to rooms in visible range`() = runTest {
|
||||||
val subscribeToVisibleRoomsLambda = lambdaRecorder { _: List<RoomId> -> }
|
val subscribeToVisibleRoomsLambda = lambdaRecorder { _: List<RoomId> -> }
|
||||||
val roomListService = FakeRoomListService(subscribeToVisibleRoomsLambda = subscribeToVisibleRoomsLambda)
|
val roomListService = FakeRoomListService(subscribeToVisibleRoomsLambda = subscribeToVisibleRoomsLambda)
|
||||||
val scope = CoroutineScope(coroutineContext + SupervisorJob())
|
|
||||||
val matrixClient = FakeMatrixClient(
|
val matrixClient = FakeMatrixClient(
|
||||||
roomListService = roomListService,
|
roomListService = roomListService,
|
||||||
)
|
)
|
||||||
|
|
@ -651,7 +608,6 @@ class RoomListPresenterTest {
|
||||||
roomListService.postAllRoomsLoadingState(RoomList.LoadingState.Loaded(1))
|
roomListService.postAllRoomsLoadingState(RoomList.LoadingState.Loaded(1))
|
||||||
roomListService.postAllRooms(listOf(roomSummary))
|
roomListService.postAllRooms(listOf(roomSummary))
|
||||||
val presenter = createRoomListPresenter(
|
val presenter = createRoomListPresenter(
|
||||||
coroutineScope = scope,
|
|
||||||
client = matrixClient,
|
client = matrixClient,
|
||||||
)
|
)
|
||||||
presenter.test {
|
presenter.test {
|
||||||
|
|
@ -681,7 +637,6 @@ class RoomListPresenterTest {
|
||||||
roomLastMessageFormatter: RoomLastMessageFormatter = FakeRoomLastMessageFormatter(),
|
roomLastMessageFormatter: RoomLastMessageFormatter = FakeRoomLastMessageFormatter(),
|
||||||
sessionPreferencesStore: SessionPreferencesStore = InMemorySessionPreferencesStore(),
|
sessionPreferencesStore: SessionPreferencesStore = InMemorySessionPreferencesStore(),
|
||||||
featureFlagService: FeatureFlagService = FakeFeatureFlagService(),
|
featureFlagService: FeatureFlagService = FakeFeatureFlagService(),
|
||||||
coroutineScope: CoroutineScope,
|
|
||||||
analyticsService: AnalyticsService = FakeAnalyticsService(),
|
analyticsService: AnalyticsService = FakeAnalyticsService(),
|
||||||
filtersPresenter: Presenter<RoomListFiltersState> = Presenter { aRoomListFiltersState() },
|
filtersPresenter: Presenter<RoomListFiltersState> = Presenter { aRoomListFiltersState() },
|
||||||
searchPresenter: Presenter<RoomListSearchState> = Presenter { aRoomListSearchState() },
|
searchPresenter: Presenter<RoomListSearchState> = Presenter { aRoomListSearchState() },
|
||||||
|
|
@ -700,7 +655,7 @@ class RoomListPresenterTest {
|
||||||
),
|
),
|
||||||
coroutineDispatchers = testCoroutineDispatchers(),
|
coroutineDispatchers = testCoroutineDispatchers(),
|
||||||
notificationSettingsService = client.notificationSettingsService(),
|
notificationSettingsService = client.notificationSettingsService(),
|
||||||
appScope = coroutineScope
|
appScope = backgroundScope
|
||||||
),
|
),
|
||||||
featureFlagService = featureFlagService,
|
featureFlagService = featureFlagService,
|
||||||
indicatorService = DefaultIndicatorService(
|
indicatorService = DefaultIndicatorService(
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,7 @@ import io.element.android.libraries.push.test.notifications.FakeImageLoaderHolde
|
||||||
import io.element.android.services.appnavstate.test.FakeAppNavigationStateService
|
import io.element.android.services.appnavstate.test.FakeAppNavigationStateService
|
||||||
import io.element.android.tests.testutils.lambda.lambdaRecorder
|
import io.element.android.tests.testutils.lambda.lambdaRecorder
|
||||||
import io.mockk.mockk
|
import io.mockk.mockk
|
||||||
import kotlinx.coroutines.CoroutineScope
|
|
||||||
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
import kotlinx.coroutines.ExperimentalCoroutinesApi
|
||||||
import kotlinx.coroutines.SupervisorJob
|
|
||||||
import kotlinx.coroutines.cancel
|
import kotlinx.coroutines.cancel
|
||||||
import kotlinx.coroutines.test.runCurrent
|
import kotlinx.coroutines.test.runCurrent
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
|
|
@ -39,7 +37,6 @@ class DefaultOnMissedCallNotificationHandlerTest {
|
||||||
@OptIn(ExperimentalCoroutinesApi::class)
|
@OptIn(ExperimentalCoroutinesApi::class)
|
||||||
@Test
|
@Test
|
||||||
fun `addMissedCallNotification - should add missed call notification`() = runTest {
|
fun `addMissedCallNotification - should add missed call notification`() = runTest {
|
||||||
val childScope = CoroutineScope(coroutineContext + SupervisorJob())
|
|
||||||
val dataFactory = FakeNotificationDataFactory(
|
val dataFactory = FakeNotificationDataFactory(
|
||||||
messageEventToNotificationsResult = lambdaRecorder { _, _, _ -> emptyList() }
|
messageEventToNotificationsResult = lambdaRecorder { _, _, _ -> emptyList() }
|
||||||
)
|
)
|
||||||
|
|
@ -59,7 +56,7 @@ class DefaultOnMissedCallNotificationHandlerTest {
|
||||||
notificationDataFactory = dataFactory,
|
notificationDataFactory = dataFactory,
|
||||||
),
|
),
|
||||||
appNavigationStateService = FakeAppNavigationStateService(),
|
appNavigationStateService = FakeAppNavigationStateService(),
|
||||||
coroutineScope = childScope,
|
coroutineScope = backgroundScope,
|
||||||
matrixClientProvider = FakeMatrixClientProvider(),
|
matrixClientProvider = FakeMatrixClientProvider(),
|
||||||
imageLoaderHolder = FakeImageLoaderHolder(),
|
imageLoaderHolder = FakeImageLoaderHolder(),
|
||||||
activeNotificationsProvider = FakeActiveNotificationsProvider(),
|
activeNotificationsProvider = FakeActiveNotificationsProvider(),
|
||||||
|
|
@ -76,8 +73,5 @@ class DefaultOnMissedCallNotificationHandlerTest {
|
||||||
runCurrent()
|
runCurrent()
|
||||||
|
|
||||||
dataFactory.messageEventToNotificationsResult.assertions().isCalledOnce()
|
dataFactory.messageEventToNotificationsResult.assertions().isCalledOnce()
|
||||||
|
|
||||||
// Cancel the coroutine scope so the test can finish
|
|
||||||
childScope.cancel()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue