summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-10-30 10:20:57 +0100
committerChristophe Simonis <chs@odoo.com>2018-10-30 10:20:57 +0100
commit4f3a20bb33d5c7c217e2c595a89588effb1425eb (patch)
treea8762abaf461dcc91745fd532c9f2a7b10811071
parent8cf43f13508e23a40aa6972c68e9de0681fe2699 (diff)
[FIX] mail: adapt forward-ported test
-rw-r--r--addons/mail/static/tests/chatter_tests.js23
1 files changed, 13 insertions, 10 deletions
diff --git a/addons/mail/static/tests/chatter_tests.js b/addons/mail/static/tests/chatter_tests.js
index e33a55aa3aa..dea2dfd5ffe 100644
--- a/addons/mail/static/tests/chatter_tests.js
+++ b/addons/mail/static/tests/chatter_tests.js
@@ -616,10 +616,12 @@ QUnit.test('chatter: post, receive and star messages', function (assert) {
QUnit.test('chatter: post a message disable the send button', function(assert) {
assert.expect(3);
var bus = new Bus();
+ var BusService = createBusService(bus);
var form = createView({
View: FormView,
model: 'partner',
data: this.data,
+ services: [ChatManager, BusService],
arch: '<form string="Partners">' +
'<sheet>' +
'<field name="foo"/>' +
@@ -634,6 +636,17 @@ QUnit.test('chatter: post a message disable the send button', function(assert) {
if (args.method === 'message_get_suggested_recipients') {
return $.when({2: []});
}
+ if (args.method === 'message_post') {
+ assert.ok(form.$('.o_composer_button_send').prop("disabled"),
+ "Send button should be disabled when a message is being sent");
+ return $.when(57923);
+ }
+ if (args.method === 'message_format') {
+ return $.when([{
+ author_id: ["42", "Me"],
+ model: 'partner',
+ }]);
+ }
return this._super(route, args);
},
intercepts: {
@@ -641,16 +654,6 @@ QUnit.test('chatter: post a message disable the send button', function(assert) {
ev.stopPropagation();
ev.data.callback($.when([]));
},
- post_message: function (ev) {
- ev.stopPropagation();
- assert.ok(form.$('.o_composer_button_send').prop("disabled"),
- "Send button should be disabled when a message is being sent");
- bus.trigger('new_message', {
- id: 0,
- model: ev.data.options.model,
- res_id: ev.data.options.res_id,
- });
- },
get_bus: function (ev) {
ev.stopPropagation();
ev.data.callback(bus);