From b26728309ae197eee3f2f167d903e81b8440d1cb Mon Sep 17 00:00:00 2001 From: Valere Date: Wed, 4 Mar 2026 19:07:53 +0100 Subject: [PATCH] fix tests --- .../call/impl/utils/ActiveCallManager.kt | 1 - .../call/DefaultElementCallEntryPointTest.kt | 4 +-- .../RingingCallNotificationCreatorTest.kt | 29 +++++++++++++++- .../call/ui/CallScreenPresenterTest.kt | 14 ++++---- .../android/features/call/ui/CallTypeTest.kt | 5 +-- .../utils/DefaultActiveCallManagerTest.kt | 33 ++++++++++++++++--- .../utils/DefaultCallWidgetProviderTest.kt | 14 ++++---- .../call/utils/FakeCallWidgetProvider.kt | 1 + .../call/test/CallNotificationData.kt | 2 ++ ...efaultCallNotificationEventResolverTest.kt | 8 +++-- .../DefaultNotifiableEventResolverTest.kt | 2 ++ .../fixtures/NotifiableEventFixture.kt | 3 ++ 12 files changed, 89 insertions(+), 27 deletions(-) diff --git a/features/call/impl/src/main/kotlin/io/element/android/features/call/impl/utils/ActiveCallManager.kt b/features/call/impl/src/main/kotlin/io/element/android/features/call/impl/utils/ActiveCallManager.kt index f0c8bcaad4..99679a8afb 100644 --- a/features/call/impl/src/main/kotlin/io/element/android/features/call/impl/utils/ActiveCallManager.kt +++ b/features/call/impl/src/main/kotlin/io/element/android/features/call/impl/utils/ActiveCallManager.kt @@ -146,7 +146,6 @@ class DefaultActiveCallManager( callType = CallType.RoomCall( sessionId = notificationData.sessionId, roomId = notificationData.roomId, - // TODO isAudioCall = notificationData.audioOnly, ), callState = CallState.Ringing(notificationData), diff --git a/features/call/impl/src/test/kotlin/io/element/android/features/call/DefaultElementCallEntryPointTest.kt b/features/call/impl/src/test/kotlin/io/element/android/features/call/DefaultElementCallEntryPointTest.kt index bfc6565d11..85cec8c586 100644 --- a/features/call/impl/src/test/kotlin/io/element/android/features/call/DefaultElementCallEntryPointTest.kt +++ b/features/call/impl/src/test/kotlin/io/element/android/features/call/DefaultElementCallEntryPointTest.kt @@ -37,7 +37,7 @@ class DefaultElementCallEntryPointTest { @Test fun `startCall - starts ElementCallActivity setup with the needed extras`() = runTest { val entryPoint = createEntryPoint() - entryPoint.startCall(CallType.RoomCall(A_SESSION_ID, A_ROOM_ID)) + entryPoint.startCall(CallType.RoomCall(A_SESSION_ID, A_ROOM_ID, isAudioCall = false)) val expectedIntent = Intent(InstrumentationRegistry.getInstrumentation().targetContext, ElementCallActivity::class.java) val intent = shadowOf(RuntimeEnvironment.getApplication()).nextStartedActivity @@ -53,7 +53,7 @@ class DefaultElementCallEntryPointTest { val entryPoint = createEntryPoint(activeCallManager = activeCallManager) entryPoint.handleIncomingCall( - callType = CallType.RoomCall(A_SESSION_ID, A_ROOM_ID), + callType = CallType.RoomCall(A_SESSION_ID, A_ROOM_ID, isAudioCall = false), eventId = AN_EVENT_ID, senderId = A_USER_ID_2, roomName = "roomName", diff --git a/features/call/impl/src/test/kotlin/io/element/android/features/call/notifications/RingingCallNotificationCreatorTest.kt b/features/call/impl/src/test/kotlin/io/element/android/features/call/notifications/RingingCallNotificationCreatorTest.kt index 28e2747ba9..c055b408dd 100644 --- a/features/call/impl/src/test/kotlin/io/element/android/features/call/notifications/RingingCallNotificationCreatorTest.kt +++ b/features/call/impl/src/test/kotlin/io/element/android/features/call/notifications/RingingCallNotificationCreatorTest.kt @@ -65,7 +65,33 @@ class RingingCallNotificationCreatorTest { getUserIconLambda.assertions().isCalledOnce() } - private suspend fun RingingCallNotificationCreator.createTestNotification() = createNotification( + @Test + fun `createNotification - use the correct style for video call`() = runTest { + val notificationCreator = createRingingCallNotificationCreator( + matrixClientProvider = FakeMatrixClientProvider(getClient = { Result.success(FakeMatrixClient()) }), + ) + + val notification = notificationCreator.createTestNotification() + assertThat(notification?.category).isEqualTo("call") + + val acceptAction = notification?.actions?.get(1) + assertThat(acceptAction?.title?.toString()).isEqualTo("Video") + } + + @Test + fun `createNotification - use the correct style for audio call`() = runTest { + val notificationCreator = createRingingCallNotificationCreator( + matrixClientProvider = FakeMatrixClientProvider(getClient = { Result.success(FakeMatrixClient()) }), + ) + + val notification = notificationCreator.createTestNotification(audioOnly = true) + assertThat(notification?.category).isEqualTo("call") + + val acceptAction = notification?.actions?.get(1) + assertThat(acceptAction?.title?.toString()).isEqualTo("Answer") + } + + private suspend fun RingingCallNotificationCreator.createTestNotification(audioOnly: Boolean = false) = createNotification( sessionId = A_SESSION_ID, roomId = A_ROOM_ID, eventId = AN_EVENT_ID, @@ -77,6 +103,7 @@ class RingingCallNotificationCreatorTest { timestamp = 0L, expirationTimestamp = 20L, textContent = "textContent", + audioOnly = audioOnly ) private fun createRingingCallNotificationCreator( diff --git a/features/call/impl/src/test/kotlin/io/element/android/features/call/ui/CallScreenPresenterTest.kt b/features/call/impl/src/test/kotlin/io/element/android/features/call/ui/CallScreenPresenterTest.kt index 09aaaf8271..b6b0120451 100644 --- a/features/call/impl/src/test/kotlin/io/element/android/features/call/ui/CallScreenPresenterTest.kt +++ b/features/call/impl/src/test/kotlin/io/element/android/features/call/ui/CallScreenPresenterTest.kt @@ -90,7 +90,7 @@ class CallScreenPresenterTest { val analyticsLambda = lambdaRecorder {} val joinedCallLambda = lambdaRecorder {} val presenter = createCallScreenPresenter( - callType = CallType.RoomCall(A_SESSION_ID, A_ROOM_ID), + callType = CallType.RoomCall(A_SESSION_ID, A_ROOM_ID, false), widgetDriver = widgetDriver, widgetProvider = widgetProvider, screenTracker = FakeScreenTracker(analyticsLambda), @@ -123,7 +123,7 @@ class CallScreenPresenterTest { fun `present - set message interceptor, send and receive messages`() = runTest { val widgetDriver = FakeMatrixWidgetDriver() val presenter = createCallScreenPresenter( - callType = CallType.RoomCall(A_SESSION_ID, A_ROOM_ID), + callType = CallType.RoomCall(A_SESSION_ID, A_ROOM_ID, false), widgetDriver = widgetDriver, screenTracker = FakeScreenTracker {}, ) @@ -154,7 +154,7 @@ class CallScreenPresenterTest { val navigator = FakeCallScreenNavigator() val widgetDriver = FakeMatrixWidgetDriver() val presenter = createCallScreenPresenter( - callType = CallType.RoomCall(A_SESSION_ID, A_ROOM_ID), + callType = CallType.RoomCall(A_SESSION_ID, A_ROOM_ID, false), widgetDriver = widgetDriver, navigator = navigator, dispatchers = testCoroutineDispatchers(useUnconfinedTestDispatcher = true), @@ -188,7 +188,7 @@ class CallScreenPresenterTest { val navigator = FakeCallScreenNavigator() val widgetDriver = FakeMatrixWidgetDriver() val presenter = createCallScreenPresenter( - callType = CallType.RoomCall(A_SESSION_ID, A_ROOM_ID), + callType = CallType.RoomCall(A_SESSION_ID, A_ROOM_ID, false), widgetDriver = widgetDriver, navigator = navigator, dispatchers = testCoroutineDispatchers(useUnconfinedTestDispatcher = true), @@ -223,7 +223,7 @@ class CallScreenPresenterTest { val navigator = FakeCallScreenNavigator() val widgetDriver = FakeMatrixWidgetDriver() val presenter = createCallScreenPresenter( - callType = CallType.RoomCall(A_SESSION_ID, A_ROOM_ID), + callType = CallType.RoomCall(A_SESSION_ID, A_ROOM_ID, false), widgetDriver = widgetDriver, navigator = navigator, dispatchers = testCoroutineDispatchers(useUnconfinedTestDispatcher = true), @@ -260,7 +260,7 @@ class CallScreenPresenterTest { val navigator = FakeCallScreenNavigator() val widgetDriver = FakeMatrixWidgetDriver() val presenter = createCallScreenPresenter( - callType = CallType.RoomCall(A_SESSION_ID, A_ROOM_ID), + callType = CallType.RoomCall(A_SESSION_ID, A_ROOM_ID, false), widgetDriver = widgetDriver, navigator = navigator, dispatchers = testCoroutineDispatchers(useUnconfinedTestDispatcher = true), @@ -300,7 +300,7 @@ class CallScreenPresenterTest { val matrixClient = FakeMatrixClient(syncService = syncService) val appForegroundStateService = FakeAppForegroundStateService() val presenter = createCallScreenPresenter( - callType = CallType.RoomCall(A_SESSION_ID, A_ROOM_ID), + callType = CallType.RoomCall(A_SESSION_ID, A_ROOM_ID, false), widgetDriver = widgetDriver, navigator = navigator, dispatchers = testCoroutineDispatchers(useUnconfinedTestDispatcher = true), diff --git a/features/call/impl/src/test/kotlin/io/element/android/features/call/ui/CallTypeTest.kt b/features/call/impl/src/test/kotlin/io/element/android/features/call/ui/CallTypeTest.kt index 0c91b2159a..c83408bd3b 100644 --- a/features/call/impl/src/test/kotlin/io/element/android/features/call/ui/CallTypeTest.kt +++ b/features/call/impl/src/test/kotlin/io/element/android/features/call/ui/CallTypeTest.kt @@ -27,6 +27,7 @@ class CallTypeTest { CallType.RoomCall( sessionId = A_SESSION_ID, roomId = A_ROOM_ID, + isAudioCall = false, ).getSessionId() ).isEqualTo(A_SESSION_ID) } @@ -38,7 +39,7 @@ class CallTypeTest { @Test fun `RoomCall stringification does not contain the URL`() { - assertThat(CallType.RoomCall(A_SESSION_ID, A_ROOM_ID).toString()) - .isEqualTo("RoomCall(sessionId=$A_SESSION_ID, roomId=$A_ROOM_ID)") + assertThat(CallType.RoomCall(A_SESSION_ID, A_ROOM_ID, false).toString()) + .isEqualTo("RoomCall(sessionId=$A_SESSION_ID, roomId=$A_ROOM_ID, isAudioCall=false)") } } diff --git a/features/call/impl/src/test/kotlin/io/element/android/features/call/utils/DefaultActiveCallManagerTest.kt b/features/call/impl/src/test/kotlin/io/element/android/features/call/utils/DefaultActiveCallManagerTest.kt index 6a4a215aec..5650eaa47f 100644 --- a/features/call/impl/src/test/kotlin/io/element/android/features/call/utils/DefaultActiveCallManagerTest.kt +++ b/features/call/impl/src/test/kotlin/io/element/android/features/call/utils/DefaultActiveCallManagerTest.kt @@ -80,6 +80,7 @@ class DefaultActiveCallManagerTest { callType = CallType.RoomCall( sessionId = callNotificationData.sessionId, roomId = callNotificationData.roomId, + isAudioCall = false, ), callState = CallState.Ringing(callNotificationData) ) @@ -91,6 +92,28 @@ class DefaultActiveCallManagerTest { verify { notificationManagerCompat.notify(notificationId, any()) } } + @OptIn(ExperimentalCoroutinesApi::class) + @Test + fun `registerIncomingCall - sets the incoming audio call as active`() = runTest { + setupShadowPowerManager() + val notificationManagerCompat = mockk(relaxed = true) + val manager = createActiveCallManager(notificationManagerCompat = notificationManagerCompat) + + val callNotificationData = aCallNotificationData(audioOnly = true) + manager.registerIncomingCall(callNotificationData) + + assertThat(manager.activeCall.value).isEqualTo( + ActiveCall( + callType = CallType.RoomCall( + sessionId = callNotificationData.sessionId, + roomId = callNotificationData.roomId, + isAudioCall = true, + ), + callState = CallState.Ringing(callNotificationData) + ) + ) + } + @OptIn(ExperimentalCoroutinesApi::class) @Test fun `registerIncomingCall - when there is an already active call adds missed call notification`() = runTest { @@ -165,7 +188,7 @@ class DefaultActiveCallManagerTest { assertThat(manager.activeCall.value).isNotNull() assertThat(manager.activeWakeLock?.isHeld).isTrue() - manager.hangUpCall(CallType.RoomCall(notificationData.sessionId, notificationData.roomId)) + manager.hangUpCall(CallType.RoomCall(notificationData.sessionId, notificationData.roomId, false)) assertThat(manager.activeCall.value).isNull() assertThat(manager.activeWakeLock?.isHeld).isFalse() @@ -192,7 +215,7 @@ class DefaultActiveCallManagerTest { val notificationData = aCallNotificationData(roomId = A_ROOM_ID) manager.registerIncomingCall(notificationData) - manager.hangUpCall(CallType.RoomCall(notificationData.sessionId, notificationData.roomId)) + manager.hangUpCall(CallType.RoomCall(notificationData.sessionId, notificationData.roomId, false)) coVerify { room.declineCall(notificationEventId = notificationData.eventId) @@ -219,7 +242,7 @@ class DefaultActiveCallManagerTest { val notificationData = aCallNotificationData(roomId = A_ROOM_ID) // Do not register the incoming call, so the manager doesn't know about it manager.hangUpCall( - callType = CallType.RoomCall(notificationData.sessionId, notificationData.roomId), + callType = CallType.RoomCall(notificationData.sessionId, notificationData.roomId, false), notificationData = notificationData, ) coVerify { @@ -321,12 +344,13 @@ class DefaultActiveCallManagerTest { val manager = createActiveCallManager(notificationManagerCompat = notificationManagerCompat) assertThat(manager.activeCall.value).isNull() - manager.joinedCall(CallType.RoomCall(A_SESSION_ID, A_ROOM_ID)) + manager.joinedCall(CallType.RoomCall(A_SESSION_ID, A_ROOM_ID, true)) assertThat(manager.activeCall.value).isEqualTo( ActiveCall( callType = CallType.RoomCall( sessionId = A_SESSION_ID, roomId = A_ROOM_ID, + isAudioCall = true, ), callState = CallState.InCall, ) @@ -429,6 +453,7 @@ class DefaultActiveCallManagerTest { callType = CallType.RoomCall( sessionId = callNotificationData.sessionId, roomId = callNotificationData.roomId, + isAudioCall = false, ), callState = CallState.Ringing(callNotificationData) ) diff --git a/features/call/impl/src/test/kotlin/io/element/android/features/call/utils/DefaultCallWidgetProviderTest.kt b/features/call/impl/src/test/kotlin/io/element/android/features/call/utils/DefaultCallWidgetProviderTest.kt index 95d5398704..093abfcd32 100644 --- a/features/call/impl/src/test/kotlin/io/element/android/features/call/utils/DefaultCallWidgetProviderTest.kt +++ b/features/call/impl/src/test/kotlin/io/element/android/features/call/utils/DefaultCallWidgetProviderTest.kt @@ -31,7 +31,7 @@ class DefaultCallWidgetProviderTest { @Test fun `getWidget - fails if the session does not exist`() = runTest { val provider = createProvider(matrixClientProvider = FakeMatrixClientProvider { Result.failure(Exception("Session not found")) }) - assertThat(provider.getWidget(A_SESSION_ID, A_ROOM_ID, "clientId", "languageTag", "theme").isFailure).isTrue() + assertThat(provider.getWidget(A_SESSION_ID, A_ROOM_ID, false, "clientId", "languageTag", "theme").isFailure).isTrue() } @Test @@ -40,7 +40,7 @@ class DefaultCallWidgetProviderTest { givenGetRoomResult(A_ROOM_ID, null) } val provider = createProvider(matrixClientProvider = FakeMatrixClientProvider { Result.success(client) }) - assertThat(provider.getWidget(A_SESSION_ID, A_ROOM_ID, "clientId", "languageTag", "theme").isFailure).isTrue() + assertThat(provider.getWidget(A_SESSION_ID, A_ROOM_ID, true, "clientId", "languageTag", "theme").isFailure).isTrue() } @Test @@ -52,7 +52,7 @@ class DefaultCallWidgetProviderTest { givenGetRoomResult(A_ROOM_ID, room) } val provider = createProvider(matrixClientProvider = FakeMatrixClientProvider { Result.success(client) }) - assertThat(provider.getWidget(A_SESSION_ID, A_ROOM_ID, "clientId", "languageTag", "theme").isFailure).isTrue() + assertThat(provider.getWidget(A_SESSION_ID, A_ROOM_ID, false, "clientId", "languageTag", "theme").isFailure).isTrue() } @Test @@ -65,7 +65,7 @@ class DefaultCallWidgetProviderTest { givenGetRoomResult(A_ROOM_ID, room) } val provider = createProvider(matrixClientProvider = FakeMatrixClientProvider { Result.success(client) }) - assertThat(provider.getWidget(A_SESSION_ID, A_ROOM_ID, "clientId", "languageTag", "theme").isFailure).isTrue() + assertThat(provider.getWidget(A_SESSION_ID, A_ROOM_ID, false, "clientId", "languageTag", "theme").isFailure).isTrue() } @Test @@ -78,7 +78,7 @@ class DefaultCallWidgetProviderTest { givenGetRoomResult(A_ROOM_ID, room) } val provider = createProvider(matrixClientProvider = FakeMatrixClientProvider { Result.success(client) }) - assertThat(provider.getWidget(A_SESSION_ID, A_ROOM_ID, "clientId", "languageTag", "theme").getOrNull()).isNotNull() + assertThat(provider.getWidget(A_SESSION_ID, A_ROOM_ID, false, "clientId", "languageTag", "theme").getOrNull()).isNotNull() } @Test @@ -101,7 +101,7 @@ class DefaultCallWidgetProviderTest { matrixClientProvider = FakeMatrixClientProvider { Result.success(client) }, activeRoomsHolder = activeRoomsHolder ) - assertThat(provider.getWidget(A_SESSION_ID, A_ROOM_ID, "clientId", "languageTag", "theme").isSuccess).isTrue() + assertThat(provider.getWidget(A_SESSION_ID, A_ROOM_ID, false, "clientId", "languageTag", "theme").isSuccess).isTrue() } @Test @@ -122,7 +122,7 @@ class DefaultCallWidgetProviderTest { callWidgetSettingsProvider = settingsProvider, appPreferencesStore = preferencesStore, ) - provider.getWidget(A_SESSION_ID, A_ROOM_ID, "clientId", "languageTag", "theme") + provider.getWidget(A_SESSION_ID, A_ROOM_ID, false, "clientId", "languageTag", "theme") assertThat(settingsProvider.providedBaseUrls).containsExactly("https://custom.element.io") } diff --git a/features/call/impl/src/test/kotlin/io/element/android/features/call/utils/FakeCallWidgetProvider.kt b/features/call/impl/src/test/kotlin/io/element/android/features/call/utils/FakeCallWidgetProvider.kt index 11e6d9e399..a76add7d28 100644 --- a/features/call/impl/src/test/kotlin/io/element/android/features/call/utils/FakeCallWidgetProvider.kt +++ b/features/call/impl/src/test/kotlin/io/element/android/features/call/utils/FakeCallWidgetProvider.kt @@ -23,6 +23,7 @@ class FakeCallWidgetProvider( override suspend fun getWidget( sessionId: SessionId, roomId: RoomId, + voiceOnly: Boolean, clientId: String, languageTag: String?, theme: String? diff --git a/features/call/test/src/main/kotlin/io/element/android/features/call/test/CallNotificationData.kt b/features/call/test/src/main/kotlin/io/element/android/features/call/test/CallNotificationData.kt index 2c7d1914c7..387a77ef8b 100644 --- a/features/call/test/src/main/kotlin/io/element/android/features/call/test/CallNotificationData.kt +++ b/features/call/test/src/main/kotlin/io/element/android/features/call/test/CallNotificationData.kt @@ -33,6 +33,7 @@ fun aCallNotificationData( timestamp: Long = 0L, expirationTimestamp: Long = 30_000L, textContent: String? = null, + audioOnly: Boolean = false, ): CallNotificationData = CallNotificationData( sessionId = sessionId, roomId = roomId, @@ -45,4 +46,5 @@ fun aCallNotificationData( timestamp = timestamp, expirationTimestamp = expirationTimestamp, textContent = textContent, + audioOnly = audioOnly ) diff --git a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/notifications/DefaultCallNotificationEventResolverTest.kt b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/notifications/DefaultCallNotificationEventResolverTest.kt index f406bccbb4..e8820a7389 100644 --- a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/notifications/DefaultCallNotificationEventResolverTest.kt +++ b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/notifications/DefaultCallNotificationEventResolverTest.kt @@ -9,6 +9,7 @@ package io.element.android.libraries.push.impl.notifications import com.google.common.truth.Truth.assertThat +import io.element.android.libraries.matrix.api.notification.CallIntent import io.element.android.libraries.matrix.api.notification.NotificationContent import io.element.android.libraries.matrix.api.notification.RtcNotificationType import io.element.android.libraries.matrix.test.AN_EVENT_ID @@ -64,10 +65,11 @@ class DefaultCallNotificationEventResolverTest { senderAvatarUrl = null, expirationTimestamp = 1567L, rtcNotificationType = RtcNotificationType.RING, + callIntent = CallIntent.VIDEO ) val notificationData = aNotificationData( - content = NotificationContent.MessageLike.RtcNotification(A_USER_ID_2, RtcNotificationType.RING, 1567) + content = NotificationContent.MessageLike.RtcNotification(A_USER_ID_2, RtcNotificationType.RING, CallIntent.VIDEO, 1567) ) val result = resolver.resolveEvent(A_SESSION_ID, notificationData) assertThat(result.getOrNull()).isEqualTo(expectedResult) @@ -111,7 +113,7 @@ class DefaultCallNotificationEventResolverTest { ) val notificationData = aNotificationData( - content = NotificationContent.MessageLike.RtcNotification(A_USER_ID_2, RtcNotificationType.NOTIFY, 0) + content = NotificationContent.MessageLike.RtcNotification(A_USER_ID_2, RtcNotificationType.NOTIFY, CallIntent.AUDIO, 0) ) val result = resolver.resolveEvent(A_SESSION_ID, notificationData) assertThat(result.getOrNull()).isEqualTo(expectedResult) @@ -155,7 +157,7 @@ class DefaultCallNotificationEventResolverTest { ) val notificationData = aNotificationData( - content = NotificationContent.MessageLike.RtcNotification(A_USER_ID_2, RtcNotificationType.RING, 0) + content = NotificationContent.MessageLike.RtcNotification(A_USER_ID_2, RtcNotificationType.RING, CallIntent.VIDEO, 0) ) val result = resolver.resolveEvent(A_SESSION_ID, notificationData) assertThat(result.getOrNull()).isEqualTo(expectedResult) diff --git a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/notifications/DefaultNotifiableEventResolverTest.kt b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/notifications/DefaultNotifiableEventResolverTest.kt index 19ef74d0b9..a25e5782ba 100644 --- a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/notifications/DefaultNotifiableEventResolverTest.kt +++ b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/notifications/DefaultNotifiableEventResolverTest.kt @@ -14,6 +14,7 @@ import io.element.android.libraries.featureflag.test.FakeFeatureFlagService import io.element.android.libraries.matrix.api.core.EventId import io.element.android.libraries.matrix.api.exception.NotificationResolverException import io.element.android.libraries.matrix.api.media.MediaSource +import io.element.android.libraries.matrix.api.notification.CallIntent import io.element.android.libraries.matrix.api.notification.NotificationContent import io.element.android.libraries.matrix.api.notification.NotificationData import io.element.android.libraries.matrix.api.notification.RtcNotificationType @@ -739,6 +740,7 @@ class DefaultNotifiableEventResolverTest { content = NotificationContent.MessageLike.RtcNotification( A_USER_ID_2, RtcNotificationType.NOTIFY, + CallIntent.VIDEO, 0 ), )) diff --git a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/notifications/fixtures/NotifiableEventFixture.kt b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/notifications/fixtures/NotifiableEventFixture.kt index 0ab39d5180..4242632fe5 100644 --- a/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/notifications/fixtures/NotifiableEventFixture.kt +++ b/libraries/push/impl/src/test/kotlin/io/element/android/libraries/push/impl/notifications/fixtures/NotifiableEventFixture.kt @@ -13,6 +13,7 @@ import io.element.android.libraries.matrix.api.core.RoomId import io.element.android.libraries.matrix.api.core.SessionId import io.element.android.libraries.matrix.api.core.ThreadId import io.element.android.libraries.matrix.api.core.UserId +import io.element.android.libraries.matrix.api.notification.CallIntent import io.element.android.libraries.matrix.api.notification.RtcNotificationType import io.element.android.libraries.matrix.api.timeline.item.event.EventType import io.element.android.libraries.matrix.test.AN_AVATAR_URL @@ -125,6 +126,7 @@ fun aNotifiableCallEvent( rtcNotificationType: RtcNotificationType = RtcNotificationType.NOTIFY, timestamp: Long = 0L, expirationTimestamp: Long = 0L, + callIntent: CallIntent = CallIntent.VIDEO, ) = NotifiableRingingCallEvent( sessionId = sessionId, eventId = eventId, @@ -142,6 +144,7 @@ fun aNotifiableCallEvent( roomAvatarUrl = roomAvatarUrl, senderAvatarUrl = senderAvatarUrl, rtcNotificationType = rtcNotificationType, + callIntent = callIntent, ) fun aFallbackNotifiableEvent(