Fix invite-specific join errors not being shown (#32621)

* Fix invite-specific join errors not being shown

* remove horrible non-jest function of getAccountData

* Use an Error

* Always dispatch an Error

* Throw a UserFriendlyError
This commit is contained in:
Will Hunt
2026-02-27 11:01:51 +00:00
committed by GitHub
parent 7461cdbf3f
commit 89fb388e57
6 changed files with 67 additions and 25 deletions
+1 -1
View File
@@ -688,7 +688,6 @@ export function mkStubRoom(
fetchRoomThreads: jest.fn().mockReturnValue(Promise.resolve()),
findEventById: jest.fn().mockReturnValue(undefined),
findPredecessor: jest.fn().mockReturnValue({ roomId: "", eventId: null }),
getAccountData: (_: EventType | string) => undefined as MatrixEvent | undefined,
getAltAliases: jest.fn().mockReturnValue([]),
getAvatarUrl: () => "mxc://avatar.url/room.png",
getCanonicalAlias: jest.fn(),
@@ -725,6 +724,7 @@ export function mkStubRoom(
getRoomUnreadNotificationCount: jest.fn().mockReturnValue(0),
getVersion: jest.fn().mockReturnValue("1"),
getBumpStamp: jest.fn().mockReturnValue(0),
getAccountData: jest.fn(),
hasMembershipState: () => false,
isElementVideoRoom: jest.fn().mockReturnValue(false),
isSpaceRoom: jest.fn().mockReturnValue(false),