diff options
| author | Xavier Dubuc <xdu@odoo.com> | 2020-07-08 11:26:14 +0000 |
|---|---|---|
| committer | Xavier Dubuc <xdu@odoo.com> | 2020-07-22 11:12:35 +0000 |
| commit | c43cdd3f192138d2eb74b2035798386ad901d27f (patch) | |
| tree | 3488c54bdb5175f16af5bbed7eed8154bcf62825 /addons/sms/static/src/components/message/message_tests.js | |
| parent | 1c2bc40a95cdedd7dcd0ad2f047887ff7278c038 (diff) | |
[IMP] mail: hide message error notifications if not origin thread
task-2282370
closes odoo/odoo#54768
X-original-commit: 4f693105bcaac7546590302cdc25c2b11b0f42cd
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/sms/static/src/components/message/message_tests.js')
| -rw-r--r-- | addons/sms/static/src/components/message/message_tests.js | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/addons/sms/static/src/components/message/message_tests.js b/addons/sms/static/src/components/message/message_tests.js index 4c26191a5b3..5876491c6d9 100644 --- a/addons/sms/static/src/components/message/message_tests.js +++ b/addons/sms/static/src/components/message/message_tests.js @@ -20,12 +20,12 @@ QUnit.module('message_tests.js', { beforeEach() { utilsBeforeEach(this); - this.createMessageComponent = async message => { + this.createMessageComponent = async (message, otherProps) => { const MessageComponent = components.Message; MessageComponent.env = this.env; - this.component = new MessageComponent(null, { + this.component = new MessageComponent(null, Object.assign({ messageLocalId: message.localId, - }); + }, otherProps)); delete MessageComponent.env; await this.component.mount(this.widget.el); }; @@ -57,6 +57,12 @@ QUnit.test('Notification Sent', async function (assert) { assert.expect(9); await this.start(); + const threadViewer = this.env.models['mail.thread_viewer'].create({ + thread: [['create', { + id: 11, + model: 'mail.channel', + }]], + }); const message = this.env.models['mail.message'].create({ id: 10, message_type: 'sms', @@ -66,8 +72,11 @@ QUnit.test('Notification Sent', async function (assert) { notification_type: 'sms', partner: [['insert', { id: 12, name: "Someone" }]], }]], + originThread: [['link', threadViewer.thread]] + }); + await this.createMessageComponent(message, { + threadViewerLocalId: threadViewer.localId }); - await this.createMessageComponent(message); assert.containsOnce( document.body, @@ -139,6 +148,12 @@ QUnit.test('Notification Error', async function (assert) { }); await this.start({ env: { bus } }); + const threadViewer = this.env.models['mail.thread_viewer'].create({ + thread: [['create', { + id: 11, + model: 'mail.channel', + }]], + }); const message = this.env.models['mail.message'].create({ id: 10, message_type: 'sms', @@ -147,8 +162,11 @@ QUnit.test('Notification Error', async function (assert) { notification_status: 'exception', notification_type: 'sms', }]], + originThread: [['link', threadViewer.thread]] + }); + await this.createMessageComponent(message, { + threadViewerLocalId: threadViewer.localId }); - await this.createMessageComponent(message); assert.containsOnce( document.body, |
