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:
parent
64733e5982
commit
f3534b42df
3 changed files with 69 additions and 11 deletions
|
@ -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"`);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue