forked from cadence/out-of-your-element
start getting d2m formatted body conversion
This commit is contained in:
parent
9569fda168
commit
1a4f92db97
4 changed files with 137 additions and 26 deletions
|
@ -2,6 +2,26 @@ const {test} = require("supertape")
|
|||
const {messageToEvent} = require("./message-to-event")
|
||||
const data = require("../../test/data")
|
||||
|
||||
test("message2event: simple plaintext", async t => {
|
||||
const events = await messageToEvent(data.message.simple_plaintext, data.guild.general)
|
||||
t.deepEqual(events, [{
|
||||
$type: "m.room.message",
|
||||
msgtype: "m.text",
|
||||
body: "ayy lmao"
|
||||
}])
|
||||
})
|
||||
|
||||
test("message2event: simple user mention", async t => {
|
||||
const events = await messageToEvent(data.message.simple_user_mention, data.guild.general)
|
||||
t.deepEqual(events, [{
|
||||
$type: "m.room.message",
|
||||
msgtype: "m.text",
|
||||
body: "@crunch god: Tell me about Phil, renowned martial arts master and creator of the Chin Trick",
|
||||
format: "org.matrix.custom.html",
|
||||
formatted_body: '<span class="d-mention d-user"><a href="https://matrix.to/#/@_ooye_crunch_god:cadence.moe">@crunch god</a></span> Tell me about Phil, renowned martial arts master and creator of the Chin Trick'
|
||||
}])
|
||||
})
|
||||
|
||||
test("message2event: attachment with no content", async t => {
|
||||
const events = await messageToEvent(data.message.attachment_no_content, data.guild.general)
|
||||
t.deepEqual(events, [{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue