From f9ee1cf5f904116e4d1d70a8eaf4ee1d58b18a3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Theys?= Date: Fri, 28 Aug 2020 10:16:37 +0000 Subject: [FIX] mail, *: rename thread viewer to thread view MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The "viewer" should be the "parent" not the view itself. This distinction will become important in a future commit to allow viewers to not display the view in some situations. Rename done as a standalone commit to ease diff readability. Part of task-2310623 closes odoo/odoo#56737 X-original-commit: 1b811e6a972d72de02965adda67c5b039bee023f Related: odoo/enterprise#12756 Signed-off-by: Alexandre Kühn (aku) Signed-off-by: Sébastien Theys (seb) --- .../static/src/components/message/message_tests.js | 46 +++++++++++----------- 1 file changed, 23 insertions(+), 23 deletions(-) (limited to 'addons/snailmail/static/src/components/message/message_tests.js') diff --git a/addons/snailmail/static/src/components/message/message_tests.js b/addons/snailmail/static/src/components/message/message_tests.js index 5736cbecf5a..fca1ba5237c 100644 --- a/addons/snailmail/static/src/components/message/message_tests.js +++ b/addons/snailmail/static/src/components/message/message_tests.js @@ -46,7 +46,7 @@ QUnit.test('Sent', async function (assert) { assert.expect(8); await this.start(); - const threadViewer = this.env.models['mail.thread_viewer'].create({ + const threadView = this.env.models['mail.thread_view'].create({ thread: [['create', { id: 11, model: 'mail.channel', @@ -60,10 +60,10 @@ QUnit.test('Sent', async function (assert) { notification_status: 'sent', notification_type: 'snail', }]], - originThread: [['link', threadViewer.thread]], + originThread: [['link', threadView.thread]], }); await this.createMessageComponent(message, { - threadViewerLocalId: threadViewer.localId + threadViewLocalId: threadView.localId }); assert.containsOnce( @@ -116,7 +116,7 @@ QUnit.test('Canceled', async function (assert) { assert.expect(8); await this.start(); - const threadViewer = this.env.models['mail.thread_viewer'].create({ + const threadView = this.env.models['mail.thread_view'].create({ thread: [['create', { id: 11, model: 'mail.channel', @@ -130,10 +130,10 @@ QUnit.test('Canceled', async function (assert) { notification_status: 'canceled', notification_type: 'snail', }]], - originThread: [['link', threadViewer.thread]], + originThread: [['link', threadView.thread]], }); await this.createMessageComponent(message, { - threadViewerLocalId: threadViewer.localId + threadViewLocalId: threadView.localId }); assert.containsOnce( @@ -186,7 +186,7 @@ QUnit.test('Pending', async function (assert) { assert.expect(8); await this.start(); - const threadViewer = this.env.models['mail.thread_viewer'].create({ + const threadView = this.env.models['mail.thread_view'].create({ thread: [['create', { id: 11, model: 'mail.channel', @@ -200,10 +200,10 @@ QUnit.test('Pending', async function (assert) { notification_status: 'ready', notification_type: 'snail', }]], - originThread: [['link', threadViewer.thread]], + originThread: [['link', threadView.thread]], }); await this.createMessageComponent(message, { - threadViewerLocalId: threadViewer.localId + threadViewLocalId: threadView.localId }); assert.containsOnce( @@ -263,7 +263,7 @@ QUnit.test('No Price Available', async function (assert) { return this._super(...arguments); }, }); - const threadViewer = this.env.models['mail.thread_viewer'].create({ + const threadView = this.env.models['mail.thread_view'].create({ thread: [['create', { id: 11, model: 'mail.channel', @@ -278,10 +278,10 @@ QUnit.test('No Price Available', async function (assert) { notification_status: 'exception', notification_type: 'snail', }]], - originThread: [['link', threadViewer.thread]], + originThread: [['link', threadView.thread]], }); await this.createMessageComponent(message, { - threadViewerLocalId: threadViewer.localId + threadViewLocalId: threadView.localId }); assert.containsOnce( @@ -349,7 +349,7 @@ QUnit.test('Credit Error', async function (assert) { return this._super(...arguments); }, }); - const threadViewer = this.env.models['mail.thread_viewer'].create({ + const threadView = this.env.models['mail.thread_view'].create({ thread: [['create', { id: 11, model: 'mail.channel', @@ -364,10 +364,10 @@ QUnit.test('Credit Error', async function (assert) { notification_status: 'exception', notification_type: 'snail', }]], - originThread: [['link', threadViewer.thread]], + originThread: [['link', threadView.thread]], }); await this.createMessageComponent(message, { - threadViewerLocalId: threadViewer.localId + threadViewLocalId: threadView.localId }); assert.containsOnce( @@ -440,7 +440,7 @@ QUnit.test('Trial Error', async function (assert) { return this._super(...arguments); }, }); - const threadViewer = this.env.models['mail.thread_viewer'].create({ + const threadView = this.env.models['mail.thread_view'].create({ thread: [['create', { id: 11, model: 'mail.channel', @@ -455,10 +455,10 @@ QUnit.test('Trial Error', async function (assert) { notification_status: 'exception', notification_type: 'snail', }]], - originThread: [['link', threadViewer.thread]], + originThread: [['link', threadView.thread]], }); await this.createMessageComponent(message, { - threadViewerLocalId: threadViewer.localId + threadViewLocalId: threadView.localId }); assert.containsOnce( @@ -539,7 +539,7 @@ QUnit.test('Format Error', async function (assert) { }); await this.start({ env: { bus } }); - const threadViewer = this.env.models['mail.thread_viewer'].create({ + const threadView = this.env.models['mail.thread_view'].create({ thread: [['create', { id: 11, model: 'mail.channel', @@ -554,10 +554,10 @@ QUnit.test('Format Error', async function (assert) { notification_status: 'exception', notification_type: 'snail', }]], - originThread: [['link', threadViewer.thread]], + originThread: [['link', threadView.thread]], }); await this.createMessageComponent(message, { - threadViewerLocalId: threadViewer.localId + threadViewLocalId: threadView.localId }); assert.containsOnce( @@ -627,11 +627,11 @@ QUnit.test('Missing Required Fields', async function (assert) { await this.start({ env: { bus }, }); - const threadViewer = this.env.models['mail.thread_viewer'].create({ + const threadView = this.env.models['mail.thread_view'].create({ thread: [['insert', { id: 20, model: 'res.partner' }]], }); const message = this.env.models['mail.message'].find(message => message.id === 10); - await this.createMessageComponent(message, { threadViewerLocalId: threadViewer.localId }); + await this.createMessageComponent(message, { threadViewLocalId: threadView.localId }); assert.containsOnce( document.body, -- cgit v1.2.3