From f83ba90e9099f0ac8242d8acfe11391a67619fdf Mon Sep 17 00:00:00 2001 From: Romeo Fragomeli Date: Wed, 15 Apr 2020 13:31:39 +0000 Subject: [PATCH] [FIX] web: avoid "False-Positive" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For testing, we use helpers functions like testUtils.dragAndDrop(). Due to the commit odoo/odoo@de924f41eebf62516a39749e5924e19875ea59e5 these methods were wrapped by a deprecated function to add a deprecation warning in the console when these methods are used. After this commit, the deprecated method will properly propagate the returned value of the original function. And so if the returned value is a Promise now we can await this Promise. This should fix some false positives on runbot in saas-13.3 (e.g. FullCalendar). closes odoo/odoo#49611 X-original-commit: 33bfe175bf1ba7824a1bef27fd7fa0898dbe8cb3 Signed-off-by: Adrien Dieudonné (adr) --- addons/web/static/src/js/tools/tools.js | 2 +- addons/web/static/tests/views/calendar_tests.js | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/web/static/src/js/tools/tools.js b/addons/web/static/src/js/tools/tools.js index f886d80d3c5..3df456de877 100644 --- a/addons/web/static/src/js/tools/tools.js +++ b/addons/web/static/src/js/tools/tools.js @@ -11,7 +11,7 @@ odoo.define('web.tools', function (require) { function deprecated(fn, message) { return function () { console.warn(message || (fn.name + ' is deprecated.')); - fn.apply(this, arguments); + return fn.apply(this, arguments); }; } diff --git a/addons/web/static/tests/views/calendar_tests.js b/addons/web/static/tests/views/calendar_tests.js index f1653d85c33..c27ac85f498 100644 --- a/addons/web/static/tests/views/calendar_tests.js +++ b/addons/web/static/tests/views/calendar_tests.js @@ -2692,7 +2692,7 @@ QUnit.module('Views', { calendar.destroy(); }); - QUnit.skip('timezone does not affect drag and drop', async function (assert) { + QUnit.test('timezone does not affect drag and drop', async function (assert) { assert.expect(10); var calendar = await createCalendarView({ @@ -2749,7 +2749,7 @@ QUnit.module('Views', { calendar.destroy(); }); - QUnit.skip('timzeone does not affect calendar with date field', async function (assert) { + QUnit.test('timzeone does not affect calendar with date field', async function (assert) { assert.expect(11); var calendar = await createCalendarView({ @@ -2819,7 +2819,7 @@ QUnit.module('Views', { calendar.destroy(); }); - QUnit.skip("drag and drop on month mode", async function (assert) { + QUnit.test("drag and drop on month mode", async function (assert) { assert.expect(2); const calendar = await createCalendarView({ @@ -2861,7 +2861,7 @@ QUnit.module('Views', { calendar.destroy(); }); - QUnit.skip("drag and drop on month mode with all_day mapping", async function (assert) { + QUnit.test("drag and drop on month mode with all_day mapping", async function (assert) { // Same test as before but in calendarEventToRecord (calendar_model.js) there is // different condition branching with all_day mapping or not assert.expect(2); @@ -2922,7 +2922,7 @@ QUnit.module('Views', { calendar.destroy(); }); - QUnit.skip('drag and drop on month mode with date_start and date_delay', async function (assert) { + QUnit.test('drag and drop on month mode with date_start and date_delay', async function (assert) { assert.expect(1); var calendar = await createCalendarView({