Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit d1a98b6

Browse files
committed
Add test to attachRelation
1 parent e8d0fb0 commit d1a98b6

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/components/views/rooms/wysiwyg_composer/message-test.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,27 @@ describe('message', () => {
7676
},
7777
});
7878
});
79+
80+
it("Should add relation to message", () => {
81+
// When
82+
const relation = {
83+
rel_type: "m.thread",
84+
event_id: "myFakeThreadId",
85+
};
86+
const content = createMessageContent(message, { permalinkCreator, relation });
87+
88+
// Then
89+
expect(content).toEqual({
90+
"body": message,
91+
"format": "org.matrix.custom.html",
92+
"formatted_body": message,
93+
"msgtype": "m.text",
94+
"m.relates_to": {
95+
"event_id": "myFakeThreadId",
96+
"rel_type": "m.thread",
97+
},
98+
});
99+
});
79100
});
80101

81102
describe('sendMessage', () => {

0 commit comments

Comments
 (0)