[FIX] mail: adapt useStore test to OWL v1.2.1

The intent of the test was to count renders but it counted calls to `onUpdate`
which was the same "by luck", but the function was changed to be called more
often than renders to fix another bug.

Proper way to count renders (after the initial mount) is just to use `patched`.

closes odoo/odoo#64352

X-original-commit: c7375ebaf8d4baa6e02534425ed634c7264ce90f
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit is contained in:
Sébastien Theys
2021-01-11 15:46:39 +00:00
parent 9fc79bbf14
commit 508a2bbc96
@@ -8,7 +8,7 @@ const {
} = require('mail/static/src/utils/test_utils.js');
const { Component, QWeb, Store } = owl;
const { useGetters } = owl.hooks;
const { onPatched, useGetters } = owl.hooks;
const { xml } = owl.tags;
QUnit.module('mail', {}, function () {
@@ -54,10 +54,9 @@ QUnit.test("compare keys, no depth, primitives", async function (assert) {
return {
res: obj.use1 ? obj.subObj1 : obj.subObj2,
};
}, {
onUpdate: () => {
count++;
},
});
onPatched(() => {
count++;
});
}
}
@@ -135,9 +134,9 @@ QUnit.test("compare keys, depth 1, proxy", async function (assert) {
compareDepth: {
array: 1,
},
onUpdate: () => {
count++;
},
});
onPatched(() => {
count++;
});
}
}