diff options
Diffstat (limited to 'addons/mail/static/tests/thread_window')
4 files changed, 20 insertions, 20 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 4b8935e81cf..b820972bef8 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 @@ -44,7 +44,7 @@ QUnit.module('Basic', { self.services.mail_service.prototype.THREAD_WINDOW_APPENDTO = '#qunit-fixture'; } - testUtils.addMockEnvironment(widget, params); + testUtils.mock.addMockEnvironment(widget, params); return widget; }; }, @@ -121,7 +121,7 @@ QUnit.test('close thread window using ESCAPE key', function (assert) { "there should be a thread window that is opened"); // focus on the thread window and press ESCAPE - $('.o_thread_window .o_composer_text_field').click(); + testUtils.dom.click($('.o_thread_window .o_composer_text_field')); assert.strictEqual(document.activeElement, $('.o_thread_window .o_composer_text_field')[0], "thread window's input should now be focused"); @@ -150,7 +150,7 @@ QUnit.test('thread window\'s input can still be focused when the UI is blocked', channel.detach(); var $input = $('<input/>', {type: 'text'}).appendTo($dom); - $input.focus().click(); + testUtils.dom.click($input.focus()); assert.strictEqual(document.activeElement, $input[0], "fake input should be focused"); @@ -159,7 +159,7 @@ QUnit.test('thread window\'s input can still be focused when the UI is blocked', // makes no sense, this test is just about // making sure that the code which forces the // focus on click is not removed - $('.o_thread_window .o_composer_text_field').click(); + testUtils.dom.click($('.o_thread_window .o_composer_text_field')); assert.strictEqual(document.activeElement, $('.o_thread_window .o_composer_text_field')[0], "thread window's input should now be focused"); @@ -181,7 +181,7 @@ QUnit.test('emoji popover should open correctly in thread windows', function (as channel.detach(); var $emojiButton = $('.o_composer_button_emoji'); - $emojiButton.trigger('focusin').focus().click(); + testUtils.dom.click($emojiButton.trigger('focusin').focus()); var $popover = $('.o_mail_emoji_container'); var done = assert.async(); @@ -254,7 +254,7 @@ QUnit.test('do not increment unread counter with focus on thread window', functi "thread should have unread counter to 0 initially"); // hard focus on thread window composer - $('.o_composer_text_field').click(); + testUtils.dom.click($('.o_composer_text_field')); // simulate receiving message from someone else var messageData = { @@ -346,7 +346,7 @@ QUnit.test('do not mark as read the newly open thread window from received messa assert.strictEqual($threadWindow.find('.o_thread_window_title').text().replace(/\s/g, ''), '#DM(1)', "open DM chat window should have one unread message"); - $threadWindow.find('.o_thread_composer').click(); + testUtils.dom.click($threadWindow.find('.o_thread_composer')); assert.strictEqual($threadWindow.find('.o_thread_window_title').text().replace(/\s/g, ''), '#DM', "open DM chat window should have message marked as read on composer focus"); diff --git a/addons/mail/static/tests/thread_window/blank_thread_window_tests.js b/addons/mail/static/tests/thread_window/blank_thread_window_tests.js index 883494a4ec6..0f3c7c7bbe7 100644 --- a/addons/mail/static/tests/thread_window/blank_thread_window_tests.js +++ b/addons/mail/static/tests/thread_window/blank_thread_window_tests.js @@ -44,7 +44,7 @@ QUnit.module('Blank', { self.services.mail_service.prototype.THREAD_WINDOW_APPENDTO = '#qunit-fixture'; } - testUtils.addMockEnvironment(widget, params); + testUtils.mock.addMockEnvironment(widget, params); return widget; }; @@ -125,7 +125,7 @@ QUnit.test('close blank thread window', function (assert) { // open blank thread window parent.call('mail_service', 'openBlankThreadWindow'); - $('.o_thread_window_close').click(); + testUtils.dom.click($('.o_thread_window_close')); assert.strictEqual($('.o_thread_window').length, 0, "blank thread window should be closed"); @@ -147,7 +147,7 @@ QUnit.test('fold blank thread window', function (assert) { var HEIGHT_OPEN = AbstractThreadWindow.prototype.HEIGHT_OPEN; // Make fold animation instantaneous - testUtils.patch(AbstractThreadWindow, { + testUtils.mock.patch(AbstractThreadWindow, { FOLD_ANIMATION_DURATION: 0, }); @@ -159,12 +159,12 @@ QUnit.test('fold blank thread window', function (assert) { console.warn('Assertion above may fail due to too narrow height of browser'); } - $('.o_thread_window_title').click(); + testUtils.dom.click($('.o_thread_window_title')); assert.strictEqual($('.o_thread_window').css('height'), HEIGHT_FOLDED, "blank thread window should be open"); parent.destroy(); - testUtils.unpatch(AbstractThreadWindow); + testUtils.mock.unpatch(AbstractThreadWindow); }); QUnit.test('open new DM chat from blank thread window', function (assert) { @@ -224,7 +224,7 @@ QUnit.test('open new DM chat from blank thread window', function (assert) { assert.strictEqual($('.ui-menu-item a').eq(1).text(), "DemoUser2", "second suggestion should be 'DemoUser2'"); - $('.ui-menu-item a').eq(0).click(); + testUtils.dom.click($('.ui-menu-item a').eq(0)); }); selectDef.then(function () { assert.strictEqual($('.o_thread_window').length, 1, @@ -299,7 +299,7 @@ QUnit.test('open already detached DM chat from blank thread window', function (a $('.o_thread_search_input input').val("D").trigger('keydown'); $.when(sourceDef, def).then(function () { - $('.ui-menu-item a').eq(0).click(); + testUtils.dom.click($('.ui-menu-item a').eq(0)); }); selectDef.then(function () { assert.strictEqual($('.o_thread_window').length, 1, 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 29e05c59da9..b87dbe0f794 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 @@ -43,7 +43,7 @@ QUnit.module('Hidden', { self.services.mail_service.prototype.THREAD_WINDOW_APPENDTO = '#qunit-fixture'; } - testUtils.addMockEnvironment(widget, params); + testUtils.mock.addMockEnvironment(widget, params); return widget; }; }, @@ -62,7 +62,7 @@ QUnit.test('hidden thread windows dropdown when not enough horizontal space (ver // single thread window. assert.expect(13); - testUtils.patch(this.services.mail_service, { + testUtils.mock.patch(this.services.mail_service, { HIDDEN_THREAD_WINDOW_DROPDOWN_BUTTON_WIDTH: 100, THREAD_WINDOW_WIDTH: 300, _getGlobalWidth: function () { return 800; }, @@ -128,7 +128,7 @@ QUnit.test('hidden thread windows dropdown when not enough horizontal space (ver 1, "should contain thread window with ID 1 in hidden dropdown menu"); parent.destroy(); - testUtils.unpatch(this.services.mail_service); + testUtils.mock.unpatch(this.services.mail_service); }); QUnit.test('hidden thread windows dropdown when not enough horizontal space (version 2)', function (assert) { @@ -146,7 +146,7 @@ QUnit.test('hidden thread windows dropdown when not enough horizontal space (ver // With button: 2 thread windows (2*250px + 100px = 600px < 800px) assert.expect(16); - testUtils.patch(this.services.mail_service, { + testUtils.mock.patch(this.services.mail_service, { HIDDEN_THREAD_WINDOW_DROPDOWN_BUTTON_WIDTH: 100, THREAD_WINDOW_WIDTH: 250, _getGlobalWidth: function () { return 800; }, @@ -219,7 +219,7 @@ QUnit.test('hidden thread windows dropdown when not enough horizontal space (ver 1, "should contain thread window with ID 2 in hidden dropdown menu"); parent.destroy(); - testUtils.unpatch(this.services.mail_service); + testUtils.mock.unpatch(this.services.mail_service); }); }); diff --git a/addons/mail/static/tests/thread_window/moderation_thread_window_tests.js b/addons/mail/static/tests/thread_window/moderation_thread_window_tests.js index 4a8cc9e2af0..b35405a2243 100644 --- a/addons/mail/static/tests/thread_window/moderation_thread_window_tests.js +++ b/addons/mail/static/tests/thread_window/moderation_thread_window_tests.js @@ -74,7 +74,7 @@ QUnit.module('Moderation', { self.services.mail_service.prototype.THREAD_WINDOW_APPENDTO = '#qunit-fixture'; } - testUtils.addMockEnvironment(widget, params); + testUtils.mock.addMockEnvironment(widget, params); return widget; }; }, |
