diff --git a/addons/mail/static/src/widgets/form_renderer/form_renderer_tests.js b/addons/mail/static/src/widgets/form_renderer/form_renderer_tests.js index e57317a7496..0984885ddb4 100644 --- a/addons/mail/static/src/widgets/form_renderer/form_renderer_tests.js +++ b/addons/mail/static/src/widgets/form_renderer/form_renderer_tests.js @@ -922,6 +922,40 @@ QUnit.test('Attachments that have been unlinked from server should be visually u ); }); +QUnit.test('chatter just contains "creating a new record" message during the creation of a new record after having displayed a chatter for an existing record', async function (assert) { + assert.expect(2); + + this.data['res.partner'].records.push({ id: 12 }); + await this.createView({ + data: this.data, + hasView: true, + View: FormView, + model: 'res.partner', + res_id: 12, + arch: ` +
+
+ +
+
+ `, + }); + + await afterNextRender(() => { + document.querySelector('.o_form_button_create').click(); + }); + assert.containsOnce( + document.body, + '.o_Message', + "Should have a single message when creating a new record" + ); + assert.strictEqual( + document.querySelector('.o_Message_content').textContent, + 'Creating a new record...', + "the message content should be in accord to the creation of this record" + ); +}); + }); }); });