summaryrefslogtreecommitdiff
path: root/addons/mail/static/tests
diff options
context:
space:
mode:
authorSébastien Theys <seb@odoo.com>2020-10-23 11:03:09 +0000
committerSébastien Theys <seb@odoo.com>2020-10-23 11:03:10 +0000
commit91ce61ba568d83190e7ed2c168fd56101474683b (patch)
tree474e1da8fefde0a147ccc68c0f5868eeff250a45 /addons/mail/static/tests
parent50b8e83597ec07e091e1a4b62184e148ddcfb6c5 (diff)
[FIX] mail: do not return members of channels in channel_info
This PR has 3 parts: The members fix itself, which is necessary for performance reasons especially at init messaging, as per described in the task. Adding the partner name in the typing payload, because due to not knowing all members anymore, it is necessary to properly display who is typing. Restrict restoring scroll position only if the corresponding scroll height is available, to make the scroll feature and particularly the corresponding tests more robust. task-2360020 closes odoo/odoo#60091 Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/mail/static/tests')
-rw-r--r--addons/mail/static/tests/helpers/mock_server.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/addons/mail/static/tests/helpers/mock_server.js b/addons/mail/static/tests/helpers/mock_server.js
index 6167682c572..5d60c66cd3a 100644
--- a/addons/mail/static/tests/helpers/mock_server.js
+++ b/addons/mail/static/tests/helpers/mock_server.js
@@ -743,12 +743,16 @@ MockServer.include({
['is_read', '=', false],
['mail_message_id', 'in', messages.map(message => message.id)],
]).length;
- return Object.assign({}, channel, {
+ const res = Object.assign({}, channel, {
info: extra_info,
last_message_id: lastMessageId,
members,
message_needaction_counter: messageNeedactionCounter,
});
+ if (channel.channel_type === 'channel') {
+ delete res.members;
+ }
+ return res;
});
},
/**
@@ -983,10 +987,12 @@ MockServer.include({
} else {
partner_id = this.currentPartnerId;
}
+ const partner = this._getRecords('res.partner', [['id', '=', partner_id]]);
const data = {
'info': 'typing_status',
'is_typing': is_typing,
'partner_id': partner_id,
+ 'partner_name': partner.name,
};
const notifications = [];
for (const channel of channels) {
@@ -1714,9 +1720,11 @@ MockServer.include({
{ active_test: false }
)[0];
return {
- "id": partner.id,
- "display_name": partner.display_name,
"active": partner.active,
+ "display_name": partner.display_name,
+ "id": partner.id,
+ "im_status": partner.im_status,
+ "name": partner.name,
};
},
});