1
0
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:
Kegan Dougal
2015-06-10 09:44:53 +01:00
parent 44e3b55975
commit f9f8816b7d
2 changed files with 7 additions and 1 deletions

View File

@ -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("?");
});
});
});