mirror of
https://github.com/vector-im/element-web.git
synced 2025-08-30 10:51:13 +02:00
take into account continuation tiles in when checking timeline messages
This commit is contained in:
parent
945daf294c
commit
9610e9b57e
@ -81,7 +81,16 @@ module.exports.checkTimelineContains = async function (session, expectedMessages
|
||||
return getMessageFromEventTile(eventTile);
|
||||
}));
|
||||
//filter out tiles that were not messages
|
||||
timelineMessages = timelineMessages .filter((m) => !!m);
|
||||
timelineMessages = timelineMessages.filter((m) => !!m);
|
||||
timelineMessages.reduce((prevSender, m) => {
|
||||
if (m.continuation) {
|
||||
m.sender = prevSender;
|
||||
return prevSender;
|
||||
} else {
|
||||
return m.sender;
|
||||
}
|
||||
});
|
||||
|
||||
expectedMessages.forEach((expectedMessage) => {
|
||||
const foundMessage = timelineMessages.find((message) => {
|
||||
return message.sender === expectedMessage.sender &&
|
||||
@ -132,6 +141,7 @@ async function getMessageFromEventTile(eventTile) {
|
||||
return {
|
||||
sender,
|
||||
body,
|
||||
encrypted: classNames.includes("mx_EventTile_verified")
|
||||
encrypted: classNames.includes("mx_EventTile_verified"),
|
||||
continuation: classNames.includes("mx_EventTile_continuation"),
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user