You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-07-31 15:24:23 +03:00
Return '?' instead of 'Unknown' for rooms which names cannot be calculated.
This makes it easier to localise in the future (if name == '?'), whilst still indicating an unknown name. Ideally we would be returning null, but this would require null checks every time the room name was accessed, which isn't ideal. This also makes the UT for this less brittle (rather than comparing literal english strings which are prone to breakage when we inevitably change 'Unknown' to 'unknown' or something else.
This commit is contained in:
@ -253,5 +253,11 @@ describe("Room", function() {
|
||||
var name = room.calculateRoomName(userA);
|
||||
expect(name).toEqual(userA);
|
||||
});
|
||||
|
||||
it("should return '?' if there is no name, alias or members in the room.",
|
||||
function() {
|
||||
var name = room.calculateRoomName(userA);
|
||||
expect(name).toEqual("?");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user