diff options
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)'); |
