[IMP] components: re-add a bunch of components tests from owl 1

Some tests are skipped because they rely on not-yet-implemented
features.
This commit is contained in:
Samuel Degueldre
2021-10-15 13:50:55 +02:00
committed by Aaron Bohy
parent 900a3ee501
commit 9d5ffe11c7
9 changed files with 430 additions and 0 deletions
@@ -479,6 +479,36 @@ exports[`lifecycle hooks patched hook is called after updating State 1`] = `
}"
`;
exports[`lifecycle hooks sub widget (inside sub node): hooks are correctly called 1`] = `
"function anonymous(bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component } = bdom;
let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers;
let block1 = createBlock(\`<div/>\`);
return function template(ctx, node, key = \\"\\") {
return block1();
}
}"
`;
exports[`lifecycle hooks sub widget (inside sub node): hooks are correctly called 2`] = `
"function anonymous(bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component } = bdom;
let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, shallowEqual } = helpers;
return function template(ctx, node, key = \\"\\") {
let b2;
if (ctx['state'].flag) {
b2 = component(\`Child\`, {}, key + \`__1\`, node, ctx);
}
return multi([b2]);
}
}"
`;
exports[`lifecycle hooks willPatch, patched hook are called on subsubcomponents, in proper order 1`] = `
"function anonymous(bdom, helpers
) {