You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2026-01-03 23:22:30 +03:00
fix lint
This commit is contained in:
@@ -622,7 +622,7 @@ describe("Room", function() {
|
||||
type: "m.room.join_rules", room: roomId, user: userA, content: {
|
||||
join_rule: rule,
|
||||
}, event: true,
|
||||
})]);;
|
||||
})]);
|
||||
};
|
||||
const setAliases = function(aliases, stateKey) {
|
||||
if (!stateKey) {
|
||||
@@ -702,14 +702,13 @@ describe("Room", function() {
|
||||
});
|
||||
|
||||
describe("Room.recalculate => Room Name using room summary", function() {
|
||||
|
||||
it("should use room heroes if available", function() {
|
||||
addMember(userA, "invite");
|
||||
addMember(userB);
|
||||
addMember(userC);
|
||||
addMember(userD);
|
||||
room.setSummary({
|
||||
"m.heroes": [userB, userC, userD]
|
||||
"m.heroes": [userB, userC, userD],
|
||||
});
|
||||
|
||||
room.recalculate(userA);
|
||||
@@ -719,7 +718,7 @@ describe("Room", function() {
|
||||
it("missing hero member state reverts to mxid", function() {
|
||||
room.setSummary({
|
||||
"m.heroes": [userB],
|
||||
"m.joined_member_count": 2
|
||||
"m.joined_member_count": 2,
|
||||
});
|
||||
|
||||
room.recalculate(userA);
|
||||
@@ -756,7 +755,7 @@ describe("Room", function() {
|
||||
addMember(userB, "join", {name: nameB});
|
||||
addMember(userC, "join", {name: nameC});
|
||||
room.setSummary({
|
||||
"m.heroes": [userB, userC]
|
||||
"m.heroes": [userB, userC],
|
||||
});
|
||||
room.recalculate(userA);
|
||||
expect(room.name).toEqual(`${nameB} and ${nameC}`);
|
||||
@@ -767,7 +766,7 @@ describe("Room", function() {
|
||||
addMember(userB, "join", {name: nameB});
|
||||
addMember(userC, "join");
|
||||
room.setSummary({
|
||||
"m.heroes": [userB]
|
||||
"m.heroes": [userB],
|
||||
});
|
||||
room.recalculate(userA);
|
||||
expect(room.name).toEqual(nameB);
|
||||
@@ -781,7 +780,6 @@ describe("Room", function() {
|
||||
room.recalculate(userA);
|
||||
expect(room.name).toEqual("Empty room");
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe("Room.recalculate => Room Name", function() {
|
||||
|
||||
@@ -355,7 +355,7 @@ describe("SyncAccumulator", function() {
|
||||
"m.heroes": ["@alice:bar"],
|
||||
"m.invited_member_count": 2,
|
||||
}));
|
||||
let summary = sa.getJSON().roomsData.join["!foo:bar"].summary;
|
||||
const summary = sa.getJSON().roomsData.join["!foo:bar"].summary;
|
||||
expect(summary["m.invited_member_count"]).toEqual(2);
|
||||
expect(summary["m.heroes"]).toEqual(["@alice:bar"]);
|
||||
});
|
||||
@@ -369,14 +369,12 @@ describe("SyncAccumulator", function() {
|
||||
"m.heroes": ["@bob:bar"],
|
||||
"m.joined_member_count": 5,
|
||||
}));
|
||||
|
||||
let summary = sa.getJSON().roomsData.join["!foo:bar"].summary;
|
||||
const summary = sa.getJSON().roomsData.join["!foo:bar"].summary;
|
||||
expect(summary["m.invited_member_count"]).toEqual(2);
|
||||
expect(summary["m.joined_member_count"]).toEqual(5);
|
||||
expect(summary["m.heroes"]).toEqual(["@bob:bar"]);
|
||||
});
|
||||
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
function syncSkeleton(joinObj) {
|
||||
|
||||
@@ -1355,7 +1355,7 @@ function calculateRoomName(room, userId, ignoreRoomNameEvent) {
|
||||
function memberNamesToRoomName(names, count = (names.length + 1)) {
|
||||
const countWithoutMe = count - 1;
|
||||
if (!names.length) {
|
||||
return count <= 1 ? "Empty room" : null;
|
||||
return count <= 1 ? "Empty room" : null;
|
||||
} else if (names.length === 1 && countWithoutMe <= 1) {
|
||||
return names[0];
|
||||
} else if (names.length === 2 && countWithoutMe <= 2) {
|
||||
|
||||
Reference in New Issue
Block a user