[FIX] web: avoid "False-Positive"

For testing, we use helpers functions like testUtils.dragAndDrop().

Due to the commit odoo/odoo@de924f41ee
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) <adr@odoo.com>
This commit is contained in:
Romeo Fragomeli
2020-04-16 07:06:24 +00:00
parent 47e6afc3e3
commit f83ba90e90
2 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -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);
};
}
@@ -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({