Add null check to room directory test (#33353)

It had a waitFor but still flaked because it threw an exception
accessing undefined.
This commit is contained in:
David Baker 2026-05-05 11:10:41 +01:00 committed by GitHub
parent c9c52a3526
commit 53d5986b16
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -77,7 +77,7 @@ describe("usePublicRoomDirectory", () => {
await waitFor(() => {
expect(result.current.ready).toBe(true);
expect(result.current.publicRooms[0].name).toEqual(query);
expect(result.current.publicRooms[0]?.name).toEqual(query);
});
});