summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/components/thread_viewer
diff options
context:
space:
mode:
authorXavier Dubuc <xdu@odoo.com>2020-07-13 12:56:55 +0000
committerXavier Dubuc <xdu@odoo.com>2020-07-16 15:53:02 +0000
commitdecf5147d1fb5569c3036d2ff45aa9350f28aa00 (patch)
treefe3de3760fdbb1ba92b5f1b8ba5322f9cc8ec01c /addons/mail/static/src/components/thread_viewer
parent9afee4f2eb4a0c421d2e0eaffd1e968ca7f84dfb (diff)
[FIX] mail: show subject of the message in inbox if set
task-2280146 closes odoo/odoo#54599 X-original-commit: 3114c7dab3c7f0f63e59f01fd06237fdc109203a Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Diffstat (limited to 'addons/mail/static/src/components/thread_viewer')
-rw-r--r--addons/mail/static/src/components/thread_viewer/thread_viewer_tests.js46
1 files changed, 46 insertions, 0 deletions
diff --git a/addons/mail/static/src/components/thread_viewer/thread_viewer_tests.js b/addons/mail/static/src/components/thread_viewer/thread_viewer_tests.js
index 6276cf11ca5..0242785795e 100644
--- a/addons/mail/static/src/components/thread_viewer/thread_viewer_tests.js
+++ b/addons/mail/static/src/components/thread_viewer/thread_viewer_tests.js
@@ -430,6 +430,52 @@ QUnit.test('mark channel as fetched and seen when a new message is loaded if com
"Channel should have been mark as seen directly"
);
});
+
+QUnit.test('show message subject if thread is mailing channel', async function (assert) {
+ assert.expect(3);
+
+ this.data['mail.message'].records = [{
+ author_id: [7, "Demo"],
+ body: "<p>Test</p>",
+ channel_ids: [100],
+ date: "2019-04-20 11:00:00",
+ id: 100,
+ is_discussion: false,
+ is_notification: false,
+ message_type: 'comment',
+ model: 'mail.channel',
+ res_id: 20,
+ subject: "Salutations, voyageur",
+ }];
+ await this.start();
+ const thread = this.env.models['mail.thread'].create({
+ channel_type: 'channel',
+ id: 100,
+ mass_mailing: true,
+ model: 'mail.channel',
+ name: "General",
+ public: 'public',
+ });
+ const threadViewer = this.env.models['mail.thread_viewer'].create({ thread: [['link', thread]] });
+ await this.createThreadViewerComponent(threadViewer);
+
+ assert.containsOnce(
+ document.body,
+ '.o_Message',
+ "should display a single message"
+ );
+ assert.containsOnce(
+ document.body,
+ '.o_Message_subject',
+ "should display subject of the message"
+ );
+ assert.strictEqual(
+ document.querySelector('.o_Message_subject').textContent,
+ "Subject: Salutations, voyageur",
+ "Subject of the message should be 'Salutations, voyageur'"
+ )
+});
+
});
});
});