diff options
| author | Vincent Schippefilt <vsc@odoo.com> | 2019-03-06 14:02:19 +0100 |
|---|---|---|
| committer | Aaron Bohy <aab@odoo.com> | 2019-03-06 20:07:17 +0100 |
| commit | 1ae64793fa489b2c1d07408cd9671bc7126f78fa (patch) | |
| tree | 23d908222f4e705b908dd23ef3823c26daf3baf0 /addons/mail/static/tests/thread_window/hidden_thread_window_tests.js | |
| parent | aa900d976f6fbb10f3940639b4d918d31a7556ca (diff) | |
[REF] mail: adapt code after jQuery update
Part of task 1896658
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Martin Geubelle <mge@odoo.com>
Co-authored-by: svs-odoo <svs@odoo.com>
Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
Diffstat (limited to 'addons/mail/static/tests/thread_window/hidden_thread_window_tests.js')
| -rw-r--r-- | addons/mail/static/tests/thread_window/hidden_thread_window_tests.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/addons/mail/static/tests/thread_window/hidden_thread_window_tests.js b/addons/mail/static/tests/thread_window/hidden_thread_window_tests.js index b87dbe0f794..691e37df362 100644 --- a/addons/mail/static/tests/thread_window/hidden_thread_window_tests.js +++ b/addons/mail/static/tests/thread_window/hidden_thread_window_tests.js @@ -48,12 +48,15 @@ QUnit.module('Hidden', { }; }, afterEach: function () { + // remove thread window dropup appended by mail service + var $target = $(this.services.mail_service.prototype.THREAD_WINDOW_APPENDTO); + $target.find('.o_thread_window_dropdown').remove(); // reset thread window append to body this.services.mail_service.prototype.THREAD_WINDOW_APPENDTO = 'body'; }, }); -QUnit.test('hidden thread windows dropdown when not enough horizontal space (version 1)', function (assert) { +QUnit.test('hidden thread windows dropdown when not enough horizontal space (version 1)', async function (assert) { // This test has hard-set global width, so that it does not depend on // the width of the screen: at most 2 thread windows visible at the // same time, and additional thread windows are in hidden while and @@ -87,9 +90,10 @@ QUnit.test('hidden thread windows dropdown when not enough horizontal space (ver data: this.data, services: this.services, }); - + await testUtils.nextTick(); parent.call('mail_service', 'getChannel', 0).detach(); parent.call('mail_service', 'getChannel', 1).detach(); + await testUtils.nextTick(); var $visibleThreadWindows = $('.o_thread_window:not(.o_thread_window_dropdown, .o_hidden)'); @@ -106,6 +110,7 @@ QUnit.test('hidden thread windows dropdown when not enough horizontal space (ver // detach a channel so that it exceeds available slots parent.call('mail_service', 'getChannel', 2).detach(); + await testUtils.nextTick(); // update list of visible thread windows $visibleThreadWindows = $('.o_thread_window:not(.o_thread_window_dropdown, .o_hidden)'); @@ -131,7 +136,7 @@ QUnit.test('hidden thread windows dropdown when not enough horizontal space (ver testUtils.mock.unpatch(this.services.mail_service); }); -QUnit.test('hidden thread windows dropdown when not enough horizontal space (version 2)', function (assert) { +QUnit.test('hidden thread windows dropdown when not enough horizontal space (version 2)', async function (assert) { // This is almost the same test as the one before, except there are // at most 3 thread windows visible, and 2 thread windows are visible // when it shows the 'hidden thread window' button. @@ -171,10 +176,11 @@ QUnit.test('hidden thread windows dropdown when not enough horizontal space (ver data: this.data, services: this.services, }); - + await testUtils.nextTick(); parent.call('mail_service', 'getChannel', 0).detach(); parent.call('mail_service', 'getChannel', 1).detach(); parent.call('mail_service', 'getChannel', 2).detach(); + await testUtils.nextTick(); var $visibleThreadWindows = $('.o_thread_window:not(.o_thread_window_dropdown, .o_hidden)'); @@ -193,6 +199,7 @@ QUnit.test('hidden thread windows dropdown when not enough horizontal space (ver // detach a channel so that it exceeds available slots parent.call('mail_service', 'getChannel', 3).detach(); + await testUtils.nextTick(); // update list of visible thread windows $visibleThreadWindows = $('.o_thread_window:not(.o_thread_window_dropdown, .o_hidden)'); |
