Use aNotificationData and aNotifiableMessageEvent
And cleanup existing tests.
This commit is contained in:
parent
ce650b06fb
commit
6fc801ede6
8 changed files with 134 additions and 149 deletions
|
|
@ -22,6 +22,7 @@ import io.element.android.libraries.matrix.api.room.RoomNotificationMode
|
|||
import io.element.android.libraries.matrix.api.room.RoomNotificationSettings
|
||||
|
||||
const val A_USER_NAME = "alice"
|
||||
const val A_USER_NAME_2 = "Bob"
|
||||
const val A_PASSWORD = "password"
|
||||
const val A_PASSPHRASE = "passphrase"
|
||||
const val A_SECRET = "secret"
|
||||
|
|
@ -55,6 +56,7 @@ val A_UNIQUE_ID = UniqueId("aUniqueId")
|
|||
val A_UNIQUE_ID_2 = UniqueId("aUniqueId2")
|
||||
|
||||
const val A_ROOM_NAME = "A room name"
|
||||
const val A_ROOM_TOPIC = "A room topic"
|
||||
const val A_ROOM_RAW_NAME = "A room raw name"
|
||||
const val A_MESSAGE = "Hello world!"
|
||||
const val A_REPLY = "OK, I'll be there!"
|
||||
|
|
@ -80,3 +82,5 @@ val AN_EXCEPTION = Exception(A_FAILURE_REASON)
|
|||
const val A_RECOVERY_KEY = "1234 5678"
|
||||
|
||||
val A_SERVER_LIST = listOf("server1", "server2")
|
||||
|
||||
const val A_TIMESTAMP = 567L
|
||||
|
|
|
|||
|
|
@ -11,10 +11,18 @@ import io.element.android.libraries.matrix.api.notification.NotificationContent
|
|||
import io.element.android.libraries.matrix.api.notification.NotificationData
|
||||
import io.element.android.libraries.matrix.test.AN_EVENT_ID
|
||||
import io.element.android.libraries.matrix.test.A_ROOM_ID
|
||||
import io.element.android.libraries.matrix.test.A_ROOM_NAME
|
||||
import io.element.android.libraries.matrix.test.A_TIMESTAMP
|
||||
import io.element.android.libraries.matrix.test.A_USER_NAME_2
|
||||
|
||||
fun aNotificationData(
|
||||
senderDisplayName: String?,
|
||||
senderIsNameAmbiguous: Boolean,
|
||||
content: NotificationContent = NotificationContent.MessageLike.RoomEncrypted,
|
||||
isDirect: Boolean = false,
|
||||
hasMention: Boolean = false,
|
||||
timestamp: Long = A_TIMESTAMP,
|
||||
senderDisplayName: String? = A_USER_NAME_2,
|
||||
senderIsNameAmbiguous: Boolean = false,
|
||||
roomDisplayName: String? = A_ROOM_NAME
|
||||
): NotificationData {
|
||||
return NotificationData(
|
||||
eventId = AN_EVENT_ID,
|
||||
|
|
@ -23,13 +31,13 @@ fun aNotificationData(
|
|||
senderDisplayName = senderDisplayName,
|
||||
senderIsNameAmbiguous = senderIsNameAmbiguous,
|
||||
roomAvatarUrl = null,
|
||||
roomDisplayName = null,
|
||||
isDirect = false,
|
||||
roomDisplayName = roomDisplayName,
|
||||
isDirect = isDirect,
|
||||
isDm = false,
|
||||
isEncrypted = false,
|
||||
isNoisy = false,
|
||||
timestamp = 0L,
|
||||
content = NotificationContent.MessageLike.RoomEncrypted,
|
||||
hasMention = false,
|
||||
timestamp = timestamp,
|
||||
content = content,
|
||||
hasMention = hasMention,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue