diff options
| author | Sébastien Theys <seb@odoo.com> | 2021-01-18 16:49:01 +0000 |
|---|---|---|
| committer | Sébastien Theys <seb@odoo.com> | 2021-01-18 16:59:02 +0000 |
| commit | e995f03a9a55280b1e9173223cdfa619ae164cc3 (patch) | |
| tree | 3aefcd4e4621f11cc971a652d7ed6f01a70765c0 /addons/mail/static/src/components/messaging_menu/messaging_menu_tests.js | |
| parent | 20d6efa817a4d839777c81d403bb8770807e784a (diff) | |
[FIX] mail, im_livechat, snailmail: use findFromIdentifyingData
find is O(n) and findFromIdentifyingData is O(1)
task-2440693
closes odoo/odoo#64712
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/mail/static/src/components/messaging_menu/messaging_menu_tests.js')
| -rw-r--r-- | addons/mail/static/src/components/messaging_menu/messaging_menu_tests.js | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/addons/mail/static/src/components/messaging_menu/messaging_menu_tests.js b/addons/mail/static/src/components/messaging_menu/messaging_menu_tests.js index 8224c088611..d049ab7a5b3 100644 --- a/addons/mail/static/src/components/messaging_menu/messaging_menu_tests.js +++ b/addons/mail/static/src/components/messaging_menu/messaging_menu_tests.js @@ -621,10 +621,10 @@ QUnit.test('filtered previews', async function (assert) { document.querySelectorAll(` .o_MessagingMenu_dropdownMenu .o_ThreadPreview[data-thread-local-id="${ - this.env.models['mail.thread'].find(thread => - thread.id === 10 && - thread.model === 'mail.channel' - ).localId + this.env.models['mail.thread'].findFromIdentifyingData({ + id: 10, + model: 'mail.channel', + }).localId }"] `).length, 1, @@ -634,10 +634,10 @@ QUnit.test('filtered previews', async function (assert) { document.querySelectorAll(` .o_MessagingMenu_dropdownMenu .o_ThreadPreview[data-thread-local-id="${ - this.env.models['mail.thread'].find(thread => - thread.id === 20 && - thread.model === 'mail.channel' - ).localId + this.env.models['mail.thread'].findFromIdentifyingData({ + id: 20, + model: 'mail.channel', + }).localId }"] `).length, 1, @@ -656,10 +656,10 @@ QUnit.test('filtered previews', async function (assert) { document.querySelectorAll(` .o_MessagingMenu_dropdownMenu .o_ThreadPreview[data-thread-local-id="${ - this.env.models['mail.thread'].find(thread => - thread.id === 10 && - thread.model === 'mail.channel' - ).localId + this.env.models['mail.thread'].findFromIdentifyingData({ + id: 10, + model: 'mail.channel', + }).localId }"] `).length, 1, @@ -669,10 +669,10 @@ QUnit.test('filtered previews', async function (assert) { document.querySelectorAll(` .o_MessagingMenu_dropdownMenu .o_ThreadPreview[data-thread-local-id="${ - this.env.models['mail.thread'].find(thread => - thread.id === 20 && - thread.model === 'mail.channel' - ).localId + this.env.models['mail.thread'].findFromIdentifyingData({ + id: 20, + model: 'mail.channel', + }).localId }"] `).length, 0, @@ -694,10 +694,10 @@ QUnit.test('filtered previews', async function (assert) { document.querySelectorAll(` .o_MessagingMenu_dropdownMenu .o_ThreadPreview[data-thread-local-id="${ - this.env.models['mail.thread'].find(thread => - thread.id === 10 && - thread.model === 'mail.channel' - ).localId + this.env.models['mail.thread'].findFromIdentifyingData({ + id: 10, + model: 'mail.channel', + }).localId }"] `).length, 0, @@ -707,10 +707,10 @@ QUnit.test('filtered previews', async function (assert) { document.querySelectorAll(` .o_MessagingMenu_dropdownMenu .o_ThreadPreview[data-thread-local-id="${ - this.env.models['mail.thread'].find(thread => - thread.id === 20 && - thread.model === 'mail.channel' - ).localId + this.env.models['mail.thread'].findFromIdentifyingData({ + id: 20, + model: 'mail.channel', + }).localId }"] `).length, 1, @@ -729,10 +729,10 @@ QUnit.test('filtered previews', async function (assert) { document.querySelectorAll(` .o_MessagingMenu_dropdownMenu .o_ThreadPreview[data-thread-local-id="${ - this.env.models['mail.thread'].find(thread => - thread.id === 10 && - thread.model === 'mail.channel' - ).localId + this.env.models['mail.thread'].findFromIdentifyingData({ + id: 10, + model: 'mail.channel', + }).localId }"] `).length, 1, @@ -742,10 +742,10 @@ QUnit.test('filtered previews', async function (assert) { document.querySelectorAll(` .o_MessagingMenu_dropdownMenu .o_ThreadPreview[data-thread-local-id="${ - this.env.models['mail.thread'].find(thread => - thread.id === 20 && - thread.model === 'mail.channel' - ).localId + this.env.models['mail.thread'].findFromIdentifyingData({ + id: 20, + model: 'mail.channel', + }).localId }"] `).length, 1, |
