mirror of https://github.com/vector-im/riot-web
Add test to attachRelation
parent
e8d0fb0ab0
commit
d1a98b632e
|
@ -76,6 +76,27 @@ describe('message', () => {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("Should add relation to message", () => {
|
||||||
|
// When
|
||||||
|
const relation = {
|
||||||
|
rel_type: "m.thread",
|
||||||
|
event_id: "myFakeThreadId",
|
||||||
|
};
|
||||||
|
const content = createMessageContent(message, { permalinkCreator, relation });
|
||||||
|
|
||||||
|
// Then
|
||||||
|
expect(content).toEqual({
|
||||||
|
"body": message,
|
||||||
|
"format": "org.matrix.custom.html",
|
||||||
|
"formatted_body": message,
|
||||||
|
"msgtype": "m.text",
|
||||||
|
"m.relates_to": {
|
||||||
|
"event_id": "myFakeThreadId",
|
||||||
|
"rel_type": "m.thread",
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('sendMessage', () => {
|
describe('sendMessage', () => {
|
||||||
|
|
Loading…
Reference in New Issue