1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-09 10:22:46 +03:00

Fix behaviour of isRelation with relation m.replace for state events (#2389)

* Add some short-circuits to skip async code

* Fix behaviour of `isRelation` with relation `m.replace` for state events
This commit is contained in:
Michael Telatynski
2022-05-20 12:32:59 +01:00
committed by GitHub
parent 81d884f899
commit e81d84502b
3 changed files with 12 additions and 7 deletions

View File

@@ -168,6 +168,8 @@ describe("Relations", function() {
await relations.setTargetEvent(originalTopic);
expect(originalTopic.replacingEvent()).toBe(null);
expect(originalTopic.getContent().topic).toBe("orig");
expect(badlyEditedTopic.isRelation()).toBe(false);
expect(badlyEditedTopic.isRelation("m.replace")).toBe(false);
await relations.addEvent(badlyEditedTopic);
expect(originalTopic.replacingEvent()).toBe(null);