Add string for membership event where both displayname & avatar change (#10880)

* Add string for membership event where both displayname & avatar change

* i18n and tests
This commit is contained in:
Michael Telatynski 2023-05-12 12:54:24 +01:00 committed by GitHub
parent 64733e5982
commit f3534b42df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 69 additions and 11 deletions

View file

@ -480,4 +480,32 @@ describe("TextForEvent", () => {
});
});
});
describe("textForMemberEvent()", () => {
beforeEach(() => {
stubClient();
});
it("should handle both displayname and avatar changing in one event", () => {
expect(
textForEvent(
new MatrixEvent({
type: "m.room.member",
sender: "@a:foo",
content: {
membership: "join",
avatar_url: "b",
displayname: "Bob",
},
prev_content: {
membership: "join",
avatar_url: "a",
displayname: "Andy",
},
state_key: "@a:foo",
}),
),
).toMatchInlineSnapshot(`"Andy changed their display name and profile picture"`);
});
});
});