Ensure consistency when rendering the sent event indicator (#11314)
* Ensure consistency when considering where to render the sent event indicator * Add test * Fix redacted edge case * Comments
This commit is contained in:
parent
5fbdbccdc6
commit
b5cbd9eeca
3 changed files with 146 additions and 107 deletions
|
@ -735,6 +735,34 @@ describe("MessagePanel", function () {
|
|||
|
||||
expect(cpt).toMatchSnapshot();
|
||||
});
|
||||
|
||||
it("should set lastSuccessful=true on non-last event if last event is not eligible for special receipt", () => {
|
||||
client.getRoom.mockImplementation((id) => (id === room.roomId ? room : null));
|
||||
const events = [
|
||||
TestUtilsMatrix.mkMessage({
|
||||
event: true,
|
||||
room: room.roomId,
|
||||
user: client.getSafeUserId(),
|
||||
ts: 1000,
|
||||
}),
|
||||
TestUtilsMatrix.mkEvent({
|
||||
event: true,
|
||||
room: room.roomId,
|
||||
user: client.getSafeUserId(),
|
||||
ts: 1000,
|
||||
type: "m.room.topic",
|
||||
skey: "",
|
||||
content: { topic: "TOPIC" },
|
||||
}),
|
||||
];
|
||||
const { container } = render(getComponent({ events, showReadReceipts: true }));
|
||||
|
||||
// just check we have the right number of tiles for now
|
||||
const tiles = container.getElementsByClassName("mx_EventTile");
|
||||
expect(tiles.length).toEqual(2);
|
||||
expect(tiles[0].querySelector(".mx_EventTile_receiptSent")).toBeTruthy();
|
||||
expect(tiles[1].querySelector(".mx_EventTile_receiptSent")).toBeFalsy();
|
||||
});
|
||||
});
|
||||
|
||||
describe("shouldFormContinuation", () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue