take into account continuation tiles in when checking timeline messages
This commit is contained in:
parent
945daf294c
commit
9610e9b57e
1 changed files with 12 additions and 2 deletions
|
@ -82,6 +82,15 @@ module.exports.checkTimelineContains = async function (session, expectedMessages
|
||||||
}));
|
}));
|
||||||
//filter out tiles that were not messages
|
//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) => {
|
expectedMessages.forEach((expectedMessage) => {
|
||||||
const foundMessage = timelineMessages.find((message) => {
|
const foundMessage = timelineMessages.find((message) => {
|
||||||
return message.sender === expectedMessage.sender &&
|
return message.sender === expectedMessage.sender &&
|
||||||
|
@ -132,6 +141,7 @@ async function getMessageFromEventTile(eventTile) {
|
||||||
return {
|
return {
|
||||||
sender,
|
sender,
|
||||||
body,
|
body,
|
||||||
encrypted: classNames.includes("mx_EventTile_verified")
|
encrypted: classNames.includes("mx_EventTile_verified"),
|
||||||
|
continuation: classNames.includes("mx_EventTile_continuation"),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue