add test case for m->d too-long message
This commit is contained in:
parent
f0ff89161a
commit
4c0aa57ba7
1 changed files with 28 additions and 0 deletions
|
@ -27,3 +27,31 @@ test("event2message: janky test", t => {
|
|||
}]
|
||||
)
|
||||
})
|
||||
|
||||
test("event2message: long messages are split", t => {
|
||||
t.deepEqual(
|
||||
eventToMessage({
|
||||
content: {
|
||||
body: ("a".repeat(130) + " ").repeat(19),
|
||||
msgtype: "m.text"
|
||||
},
|
||||
event_id: "$g07oYSZFWBkxohNEfywldwgcWj1hbhDzQ1sBAKvqOOU",
|
||||
origin_server_ts: 1688301929913,
|
||||
room_id: "!kLRqKKUQXcibIMtOpl:cadence.moe",
|
||||
sender: "@cadence:cadence.moe",
|
||||
type: "m.room.message",
|
||||
unsigned: {
|
||||
age: 405299
|
||||
}
|
||||
}),
|
||||
[{
|
||||
username: "cadence",
|
||||
content: (("a".repeat(130) + " ").repeat(15)).slice(0, -1),
|
||||
avatar_url: undefined
|
||||
}, {
|
||||
username: "cadence",
|
||||
content: (("a".repeat(130) + " ").repeat(4)).slice(0, -1),
|
||||
avatar_url: undefined
|
||||
}]
|
||||
)
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue