From fde4fe871f4709f8512accfe4c4994e7efd7ea02 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 18 Jun 2025 14:30:44 +0200 Subject: [PATCH] Add test for UnableToResolve case. --- .../notification/RustNotificationServiceTest.kt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/notification/RustNotificationServiceTest.kt b/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/notification/RustNotificationServiceTest.kt index c0d7ddf09b..0349523d11 100644 --- a/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/notification/RustNotificationServiceTest.kt +++ b/libraries/matrix/impl/src/test/kotlin/io/element/android/libraries/matrix/impl/notification/RustNotificationServiceTest.kt @@ -47,6 +47,20 @@ class RustNotificationServiceTest { ) } + @Test + fun `test unable to resolve event`() = runTest { + val notificationClient = FakeFfiNotificationClient( + notificationItemResult = emptyMap(), + ) + val sut = createRustNotificationService( + notificationClient = notificationClient, + ) + val result = sut.getNotifications(mapOf(A_ROOM_ID to listOf(AN_EVENT_ID))).getOrThrow()[AN_EVENT_ID]!! + assertThat(result.content).isEqualTo( + NotificationContent.MessageLike.UnableToResolve + ) + } + private fun TestScope.createRustNotificationService( notificationClient: NotificationClient = FakeFfiNotificationClient(), clock: SystemClock = FakeSystemClock(),