summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/components/composer/composer_tests.js
diff options
context:
space:
mode:
Diffstat (limited to 'addons/mail/static/src/components/composer/composer_tests.js')
-rw-r--r--addons/mail/static/src/components/composer/composer_tests.js96
1 files changed, 48 insertions, 48 deletions
diff --git a/addons/mail/static/src/components/composer/composer_tests.js b/addons/mail/static/src/components/composer/composer_tests.js
index 404990eb4c2..fcea8b5a3ab 100644
--- a/addons/mail/static/src/components/composer/composer_tests.js
+++ b/addons/mail/static/src/components/composer/composer_tests.js
@@ -167,10 +167,10 @@ QUnit.test('mailing channel composer: basic rendering', async function (assert)
// value and a random unique id that will be referenced in the test
this.data['mail.channel'].records.push({ id: 20, mass_mailing: true });
await this.start();
- const thread = this.env.models['mail.thread'].find(thread =>
- thread.id === 20 &&
- thread.model === 'mail.channel'
- );
+ const thread = this.env.models['mail.thread'].findFromIdentifyingData({
+ id: 20,
+ model: 'mail.channel',
+ });
await this.createComposerComponent(thread.composer);
assert.containsOnce(
document.body,
@@ -1286,10 +1286,10 @@ QUnit.test('send message when enter is pressed while holding ctrl key (this shor
return this._super(...arguments);
},
});
- const thread = this.env.models['mail.thread'].find(thread =>
- thread.id === 20 &&
- thread.model === 'mail.channel'
- );
+ const thread = this.env.models['mail.thread'].findFromIdentifyingData({
+ id: 20,
+ model: 'mail.channel',
+ });
await this.createComposerComponent(thread.composer, {
textInputSendShortcuts: ['ctrl-enter'],
});
@@ -1341,10 +1341,10 @@ QUnit.test('send message when enter is pressed while holding meta key (this shor
return this._super(...arguments);
},
});
- const thread = this.env.models['mail.thread'].find(thread =>
- thread.id === 20 &&
- thread.model === 'mail.channel'
- );
+ const thread = this.env.models['mail.thread'].findFromIdentifyingData({
+ id: 20,
+ model: 'mail.channel',
+ });
await this.createComposerComponent(thread.composer, {
textInputSendShortcuts: ['meta-enter'],
});
@@ -1395,10 +1395,10 @@ QUnit.test('composer text input cleared on message post', async function (assert
return this._super(...arguments);
},
});
- const thread = this.env.models['mail.thread'].find(thread =>
- thread.id === 20 &&
- thread.model === 'mail.channel'
- );
+ const thread = this.env.models['mail.thread'].findFromIdentifyingData({
+ id: 20,
+ model: 'mail.channel',
+ });
await this.createComposerComponent(thread.composer);
// Type message
await afterNextRender(() => {
@@ -1455,10 +1455,10 @@ QUnit.test('composer inputs cleared on message post in composer of a mailing cha
return this._super(...arguments);
},
});
- const thread = this.env.models['mail.thread'].find(thread =>
- thread.id === 20 &&
- thread.model === 'mail.channel'
- );
+ const thread = this.env.models['mail.thread'].findFromIdentifyingData({
+ id: 20,
+ model: 'mail.channel',
+ });
await this.createComposerComponent(thread.composer);
// Type message
await afterNextRender(() => {
@@ -1505,10 +1505,10 @@ QUnit.test('composer with thread typing notification status', async function (as
// with a random unique id that will be referenced in the test
this.data['mail.channel'].records.push({ id: 20 });
await this.start();
- const thread = this.env.models['mail.thread'].find(thread =>
- thread.id === 20 &&
- thread.model === 'mail.channel'
- );
+ const thread = this.env.models['mail.thread'].findFromIdentifyingData({
+ id: 20,
+ model: 'mail.channel',
+ });
await this.createComposerComponent(thread.composer, { hasThreadTyping: true });
assert.containsOnce(
@@ -1537,10 +1537,10 @@ QUnit.test('current partner notify is typing to other thread members', async fun
return this._super(...arguments);
},
});
- const thread = this.env.models['mail.thread'].find(thread =>
- thread.id === 20 &&
- thread.model === 'mail.channel'
- );
+ const thread = this.env.models['mail.thread'].findFromIdentifyingData({
+ id: 20,
+ model: 'mail.channel',
+ });
await this.createComposerComponent(thread.composer, { hasThreadTyping: true });
document.querySelector(`.o_ComposerTextInput_textarea`).focus();
@@ -1569,10 +1569,10 @@ QUnit.test('current partner is typing should not translate on textual typing sta
return this._super(...arguments);
},
});
- const thread = this.env.models['mail.thread'].find(thread =>
- thread.id === 20 &&
- thread.model === 'mail.channel'
- );
+ const thread = this.env.models['mail.thread'].findFromIdentifyingData({
+ id: 20,
+ model: 'mail.channel',
+ });
await this.createComposerComponent(thread.composer, { hasThreadTyping: true });
document.querySelector(`.o_ComposerTextInput_textarea`).focus();
@@ -1608,10 +1608,10 @@ QUnit.test('current partner notify no longer is typing to thread members after 5
return this._super(...arguments);
},
});
- const thread = this.env.models['mail.thread'].find(thread =>
- thread.id === 20 &&
- thread.model === 'mail.channel'
- );
+ const thread = this.env.models['mail.thread'].findFromIdentifyingData({
+ id: 20,
+ model: 'mail.channel',
+ });
await this.createComposerComponent(thread.composer, { hasThreadTyping: true });
document.querySelector(`.o_ComposerTextInput_textarea`).focus();
@@ -1646,10 +1646,10 @@ QUnit.test('current partner notify is typing again to other members every 50s of
return this._super(...arguments);
},
});
- const thread = this.env.models['mail.thread'].find(thread =>
- thread.id === 20 &&
- thread.model === 'mail.channel'
- );
+ const thread = this.env.models['mail.thread'].findFromIdentifyingData({
+ id: 20,
+ model: 'mail.channel',
+ });
await this.createComposerComponent(thread.composer, { hasThreadTyping: true });
document.querySelector(`.o_ComposerTextInput_textarea`).focus();
@@ -1985,10 +1985,10 @@ QUnit.test('send message only once when button send is clicked twice quickly', a
return this._super(...arguments);
},
});
- const thread = this.env.models['mail.thread'].find(thread =>
- thread.id === 20 &&
- thread.model === 'mail.channel'
- );
+ const thread = this.env.models['mail.thread'].findFromIdentifyingData({
+ id: 20,
+ model: 'mail.channel',
+ });
await this.createComposerComponent(thread.composer);
// Type message
await afterNextRender(() => {
@@ -2018,10 +2018,10 @@ QUnit.test('send message only once when enter is pressed twice quickly', async f
return this._super(...arguments);
},
});
- const thread = this.env.models['mail.thread'].find(thread =>
- thread.id === 20 &&
- thread.model === 'mail.channel'
- );
+ const thread = this.env.models['mail.thread'].findFromIdentifyingData({
+ id: 20,
+ model: 'mail.channel',
+ });
await this.createComposerComponent(thread.composer, {
textInputSendShortcuts: ['enter'],
});