diff options
| author | Xavier Dubuc <xdu@odoo.com> | 2020-07-13 12:56:55 +0000 |
|---|---|---|
| committer | Xavier Dubuc <xdu@odoo.com> | 2020-07-16 15:53:02 +0000 |
| commit | decf5147d1fb5569c3036d2ff45aa9350f28aa00 (patch) | |
| tree | fe3de3760fdbb1ba92b5f1b8ba5322f9cc8ec01c /addons/mail/static/src/components/discuss | |
| parent | 9afee4f2eb4a0c421d2e0eaffd1e968ca7f84dfb (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/discuss')
| -rw-r--r-- | addons/mail/static/src/components/discuss/tests/discuss_inbox_tests.js | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/addons/mail/static/src/components/discuss/tests/discuss_inbox_tests.js b/addons/mail/static/src/components/discuss/tests/discuss_inbox_tests.js index 7cb962c1b27..4cd20d7632b 100644 --- a/addons/mail/static/src/components/discuss/tests/discuss_inbox_tests.js +++ b/addons/mail/static/src/components/discuss/tests/discuss_inbox_tests.js @@ -411,6 +411,99 @@ QUnit.test('"reply to" composer should send message if message replied to is not assert.verifySteps(['message_post']); }); +QUnit.test('show subject of message in inbox', async function (assert) { + assert.expect(3); + + this.data['mail.message'].records = [{ + author_id: [7, "Demo"], + body: "<p>Test</p>", + date: "2019-04-20 11:00:00", + id: 100, + is_discussion: false, + is_notification: false, + message_type: 'comment', + needaction: true, + needaction_partner_ids: [3], + model: 'mail.channel', + res_id: 20, + subject: "Salutations, voyageur", + }]; + + await this.start({ + env: { + session: { + name: 'Admin', + partner_display_name: 'Your Company, Admin', + partner_id: 3, + uid: 2, + }, + }, + }); + 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'" + ) +}); + +QUnit.test('show subject of message in history', async function (assert) { + assert.expect(3); + + this.data['mail.message'].records = [{ + author_id: [7, "Demo"], + body: "<p>Test</p>", + date: "2019-04-20 11:00:00", + history_partner_ids: [3], + id: 100, + message_type: 'comment', + model: 'project.task', + record_name: "Refactoring", + res_id: 20, + subject: "Salutations, voyageur", + }]; + + await this.start({ + discuss: { + params: { + default_active_id: 'mail.box_history', + }, + }, + env: { + session: { + name: 'Admin', + partner_display_name: 'Your Company, Admin', + partner_id: 3, + uid: 2, + }, + }, + }); + 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'" + ) +}); + }); }); }); |
