mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[REF] tests: improve test helpers
- remove snapshotApp - remove addTemplates - simplify helpers - make sure snapshotted templates are snapshotted with the app config
This commit is contained in:
committed by
Samuel Degueldre
parent
f19de73b0f
commit
a727347d60
@@ -2,20 +2,6 @@
|
||||
|
||||
exports[`t-key t-foreach with t-key switch component position 1`] = `
|
||||
"function anonymous(bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].key;
|
||||
return block1([d1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-key t-foreach with t-key switch component position 2`] = `
|
||||
"function anonymous(bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { prepareList, withKey } = helpers;
|
||||
@@ -37,7 +23,7 @@ exports[`t-key t-foreach with t-key switch component position 2`] = `
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-key t-key on Component 1`] = `
|
||||
exports[`t-key t-foreach with t-key switch component position 2`] = `
|
||||
"function anonymous(bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
@@ -51,17 +37,31 @@ exports[`t-key t-key on Component 1`] = `
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-key t-key on Component 1`] = `
|
||||
"function anonymous(bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const tKey_1 = ctx['key'];
|
||||
let b2 = toggler(tKey_1, component(\`Child\`, {key: ctx['key']}, tKey_1 + key + \`__2\`, node, ctx));
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-key t-key on Component 2`] = `
|
||||
"function anonymous(bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const tKey_1 = ctx['key'];
|
||||
let b2 = toggler(tKey_1, component(\`Child\`, {key: ctx['key']}, tKey_1 + key + \`__2\`, node, ctx));
|
||||
return block1([], [b2]);
|
||||
let d1 = ctx['props'].key;
|
||||
return block1([d1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
@@ -71,20 +71,6 @@ exports[`t-key t-key on Component as a function 1`] = `
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let d1 = ctx['props'].key;
|
||||
return block1([d1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-key t-key on Component as a function 2`] = `
|
||||
"function anonymous(bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
|
||||
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
@@ -95,7 +81,7 @@ exports[`t-key t-key on Component as a function 2`] = `
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-key t-key on multiple Components 1`] = `
|
||||
exports[`t-key t-key on Component as a function 2`] = `
|
||||
"function anonymous(bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
@@ -109,7 +95,7 @@ exports[`t-key t-key on multiple Components 1`] = `
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-key t-key on multiple Components 2`] = `
|
||||
exports[`t-key t-key on multiple Components 1`] = `
|
||||
"function anonymous(bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
@@ -126,7 +112,7 @@ exports[`t-key t-key on multiple Components 2`] = `
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-key t-key on multiple Components with t-call 1 1`] = `
|
||||
exports[`t-key t-key on multiple Components 2`] = `
|
||||
"function anonymous(bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
@@ -140,19 +126,7 @@ exports[`t-key t-key on multiple Components with t-call 1 1`] = `
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-key t-key on multiple Components with t-call 1 2`] = `
|
||||
"function anonymous(bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const tKey_1 = ctx['key'];
|
||||
return toggler(tKey_1, component(\`Child\`, {key: ctx['key']}, tKey_1 + key + \`__2\`, node, ctx));
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-key t-key on multiple Components with t-call 1 3`] = `
|
||||
exports[`t-key t-key on multiple Components with t-call 1 1`] = `
|
||||
"function anonymous(bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
@@ -179,7 +153,19 @@ exports[`t-key t-key on multiple Components with t-call 1 3`] = `
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-key t-key on multiple Components with t-call 2 1`] = `
|
||||
exports[`t-key t-key on multiple Components with t-call 1 2`] = `
|
||||
"function anonymous(bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
const tKey_1 = ctx['key'];
|
||||
return toggler(tKey_1, component(\`Child\`, {key: ctx['key']}, tKey_1 + key + \`__2\`, node, ctx));
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-key t-key on multiple Components with t-call 1 3`] = `
|
||||
"function anonymous(bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
@@ -193,6 +179,22 @@ exports[`t-key t-key on multiple Components with t-call 2 1`] = `
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-key t-key on multiple Components with t-call 2 1`] = `
|
||||
"function anonymous(bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`calledTemplate\`);
|
||||
|
||||
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let b2 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
return block1([], [b2]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
exports[`t-key t-key on multiple Components with t-call 2 2`] = `
|
||||
"function anonymous(bdom, helpers
|
||||
) {
|
||||
@@ -212,14 +214,12 @@ exports[`t-key t-key on multiple Components with t-call 2 3`] = `
|
||||
"function anonymous(bdom, helpers
|
||||
) {
|
||||
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
||||
let { getTemplate } = helpers;
|
||||
const callTemplate_2 = getTemplate(\`calledTemplate\`);
|
||||
|
||||
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
||||
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
||||
|
||||
return function template(ctx, node, key = \\"\\") {
|
||||
let b2 = callTemplate_2.call(this, ctx, node, key + \`__1\`);
|
||||
return block1([], [b2]);
|
||||
let d1 = ctx['props'].key;
|
||||
return block1([d1]);
|
||||
}
|
||||
}"
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user