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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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);
});
});