diff options
| author | Alexandre Kühn <aku@odoo.com> | 2018-08-29 13:56:53 +0200 |
|---|---|---|
| committer | Alexandre Kühn <aku@odoo.com> | 2018-08-30 13:26:07 +0200 |
| commit | be44efe852e96840ff6db139ea66952cbad74e1a (patch) | |
| tree | f94923504aa3b7982c7867d7c170ab54fb8df474 /addons/mail/static/tests/thread_window/basic_thread_window_tests.js | |
| parent | bd43df539ff08c3caa4799226922633a928e37a2 (diff) | |
[REF] mail: clean some JS code
1. Removed `getLocalMessages` method in mailbox, and replaced
with an override on `getMessages`.
(This method was used before the distinction was made
between `getMessages` and `fetchMessages`)
2. Removed unused method `_warnUpdatedUnreadCounter` in
abstract thread window.
(Leftover from an early POC)
3. Set the default value `''` for the status of a thread.
(The method `getStatus` should always return a string)
4. Enforce default value `false` for detached status of channel.
(The method `isDetached` should always return a boolean)
5. Improve readability of some tests.
(removed useless variables and/or redundant code)
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 | 19 |
1 files changed, 3 insertions, 16 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 ffda7d95700..347682e68df 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 @@ -196,23 +196,10 @@ QUnit.test('emoji popover should open correctly in thread windows', function (as QUnit.test('do not increase unread counter when receiving message with myself as author', function (assert) { assert.expect(4); - var generalChannelID = 1; - var myselfPartnerID = 44; - - this.data.initMessaging = { - channel_slots: { - channel_channel: [{ - id: generalChannelID, - channel_type: 'channel', - name: "general", - }], - }, - }; - var parent = this.createParent({ data: this.data, services: this.services, - session: { partner_id: myselfPartnerID } + session: { partner_id: 3 } }); // get channel instance to link to thread window @@ -228,14 +215,14 @@ QUnit.test('do not increase unread counter when receiving message with myself as // simulate receiving message from myself var messageData = { - author_id: [myselfPartnerID, "Myself"], + author_id: [3, "Myself"], body: "<p>Test message</p>", id: 2, model: 'mail.channel', res_id: 1, channel_ids: [1], }; - var notification = [[false, 'mail.channel', generalChannelID], messageData]; + var notification = [[false, 'mail.channel', 1], messageData]; parent.call('bus_service', 'trigger', 'notification', [notification]); threadWindowHeaderText = $('.o_thread_window_header').text().replace(/\s/g, ""); |
