1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-08-06 10:22:45 +03:00

Fix start DM with pending third party invite (#10347)

* Fix start DM with pending third party invite

* Make the fix more clearly visible

---------

Co-authored-by: Janne Mareike Koschinski <jannemk@element.io>
Co-authored-by: Janne Mareike Koschinski <janne@kuschku.de>
This commit is contained in:
Michael Weimann
2023-03-10 15:39:53 +01:00
committed by GitHub
parent 102c4e5ae9
commit d53e91802d
2 changed files with 28 additions and 4 deletions

View File

@@ -135,6 +135,10 @@ describe("findDMForUser", () => {
return [room1.roomId, room2.roomId, room3.roomId, room4.roomId, room5.roomId, unknownRoomId];
}
if (userId === thirdPartyId) {
return [room7.roomId];
}
return [];
});
});
@@ -174,4 +178,8 @@ describe("findDMForUser", () => {
it("should find a room with a pending third-party invite", () => {
expect(findDMForUser(mockClient, thirdPartyId)).toBe(room7);
});
it("should not find a room for an unknown Id", () => {
expect(findDMForUser(mockClient, "@unknown:example.com")).toBe(undefined);
});
});