diff options
| author | XavierDo <xdo@odoo.com> | 2019-01-07 12:31:18 +0000 |
|---|---|---|
| committer | XavierDo <xdo@odoo.com> | 2019-02-07 08:54:33 +0000 |
| commit | c21d200285ebeb646b8e5be6ba233f96d9714c6f (patch) | |
| tree | 456e22dba6bd235f1ed1143b224097f6a0e0f1dd /addons/mail/static/tests/thread_window/basic_thread_window_tests.js | |
| parent | b60224c41cb6c9817fd328bb60b21681e619fb26 (diff) | |
[IMP] mail: add ooo status in chats windows.
In a chat window with a single usert (dm_chat) the ooo status of the
other user is displayed on the top when set.
Task: 1856205
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.js | 63 |
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(); +}); + }); }); }); |
