summaryrefslogtreecommitdiff
path: root/addons/mail/static/tests/thread_window/basic_thread_window_tests.js
diff options
context:
space:
mode:
authorRobot Odoo <xmo+roboto@odoo.com>2019-02-11 12:57:48 +0100
committerGitHub <noreply@github.com>2019-02-11 12:57:48 +0100
commit47bb7ef7968cb3c5c11f767df06fcf09333a2b13 (patch)
tree1e86b27e45fe2b5803294e886227495fdd68a96b /addons/mail/static/tests/thread_window/basic_thread_window_tests.js
parent768844040f887868759309ad101fe50191fc949a (diff)
parent975164473ccd51c00eee5917dddbd8be71b5aefc (diff)
[MERGE] mail, hr_holidays, *: add out of office status
*: base, bus, mail_bot, test_mail Before this task, it was not easy to tell when a user is not available (or is on holiday) from conversations, such as from chat windows. With this task, a user can now tell that he is out-of-office from the user menu preferences, by defining an an out-of-office message. This information will be displayed to other users from chat conversations and mention suggestions (i.e. with `@`). Also, the computation of the user `im_status` has been changed when he has an active leave: an out-of-office message can be set on the leave, and this will be displayed on conversations instead of the user's out-of-office message from the user menu preferences. Task: 1856205 closes odoo/odoo#29974
Diffstat (limited to 'addons/mail/static/tests/thread_window/basic_thread_window_tests.js')
-rw-r--r--addons/mail/static/tests/thread_window/basic_thread_window_tests.js63
1 files changed, 63 insertions, 0 deletions
diff --git a/addons/mail/static/tests/thread_window/basic_thread_window_tests.js b/addons/mail/static/tests/thread_window/basic_thread_window_tests.js
index 3fc942b506f..5a0bc62f880 100644
--- a/addons/mail/static/tests/thread_window/basic_thread_window_tests.js
+++ b/addons/mail/static/tests/thread_window/basic_thread_window_tests.js
@@ -632,6 +632,69 @@ QUnit.test('do not auto-focus chat window on receiving new message from new DM',
parent.destroy();
});
+QUnit.test('out-of-office status in thread window', function (assert) {
+ assert.expect(1);
+ this.data = {
+ 'mail.message': {
+ fields: {},
+ records: [],
+ },
+ initMessaging: {
+ channel_slots: {
+ channel_channel: [{
+ id: 1,
+ name: "DM",
+ channel_type: "chat",
+ message_unread_counter: 0,
+ direct_partner: [{ id: 666, name: 'DemoUser1', im_status: 'online', out_of_office_message: 'Please don\'t disturb'}],
+ }],
+ },
+ },
+ };
+ var parent = this.createParent({
+ data: this.data,
+ services: this.services,
+ });
+ // detach channel 1, so that it opens corresponding thread window.
+ parent.call('mail_service', 'getChannel', 1).detach();
+
+ var $threadWindow = $('.o_thread_window');
+ assert.containsOnce($threadWindow, '.o_out_of_office_text');
+
+ parent.destroy();
+});
+
+QUnit.test('no out-of-office status in thread window', function (assert) {
+ assert.expect(1);
+ this.data = {
+ 'mail.message': {
+ fields: {},
+ records: [],
+ },
+ initMessaging: {
+ channel_slots: {
+ channel_channel: [{
+ id: 1,
+ name: "DM",
+ channel_type: "chat",
+ message_unread_counter: 0,
+ direct_partner: [{ id: 666, name: 'DemoUser1', im_status: 'online'}],
+ }],
+ },
+ },
+ };
+ var parent = this.createParent({
+ data: this.data,
+ services: this.services,
+ });
+ // detach channel 1, so that it opens corresponding thread window.
+ parent.call('mail_service', 'getChannel', 1).detach();
+
+ var $threadWindow = $('.o_thread_window');
+ assert.containsNone($threadWindow, '.o_out_of_office_text');
+ parent.destroy();
+});
+
});
});
});