[FIX] mail: guard the thread name and test the fallback
task-2343800 closes odoo/odoo#58848 X-original-commit: 13d78eda1243a5a625473adbae981b2891221ffc Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
<b class="text-muted">To: </b>
|
||||
<em class="text-muted">Followers of </em>
|
||||
<b>
|
||||
<t t-if="composer.thread">
|
||||
<t t-if="composer.thread and composer.thread.name">
|
||||
 "<t t-esc="composer.thread.name"/>"
|
||||
</t>
|
||||
<t t-else="">
|
||||
|
||||
@@ -1842,6 +1842,23 @@ QUnit.test('remove an uploading attachment aborts upload', async function (asser
|
||||
});
|
||||
});
|
||||
|
||||
QUnit.test("basic rendering when sending a message to the followers and thread doesn't have a name", async function (assert) {
|
||||
assert.expect(1);
|
||||
|
||||
await this.start();
|
||||
const thread = this.env.models['mail.thread'].create({
|
||||
composer: [['create', { isLog: false }]],
|
||||
id: 20,
|
||||
model: 'res.partner',
|
||||
});
|
||||
await this.createComposerComponent(thread.composer, { hasFollowers: true });
|
||||
assert.strictEqual(
|
||||
document.querySelector('.o_Composer_followers').textContent.replace(/\s+/g, ''),
|
||||
"To:Followersofthisdocument",
|
||||
"Composer should display \"To: Followers of this document\" if the thread as no name."
|
||||
);
|
||||
});
|
||||
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user