Files
owl/tests/components/__snapshots__/t_props.test.ts.snap
T

143 lines
4.1 KiB
Plaintext
Raw Normal View History

2021-10-20 15:25:32 +02:00
// Jest Snapshot v1, https://goo.gl/fbAQLP
2021-11-13 17:10:06 +01:00
exports[`t-props basic use 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2021-11-13 17:10:06 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, true, false);
2021-11-13 17:10:06 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<div><block-child-0/></div>\`);
2021-11-13 17:10:06 +01:00
return function template(ctx, node, key = \\"\\") {
const b2 = comp1(Object.assign({}, ctx['some'].obj), key + \`__1\`, node, this, null);
2021-12-20 11:19:59 +01:00
return block1([], [b2]);
2021-11-13 17:10:06 +01:00
}
}"
`;
exports[`t-props basic use 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2021-11-13 17:10:06 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2021-11-13 17:10:06 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<span><block-text-0/></span>\`);
2021-11-13 17:10:06 +01:00
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].a+ctx['props'].b;
return block1([txt1]);
2021-11-13 17:10:06 +01:00
}
}"
`;
exports[`t-props child receives a copy of the t-props object, not the original 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, true, false);
return function template(ctx, node, key = \\"\\") {
return comp1(Object.assign({}, ctx['childProps']), key + \`__1\`, node, this, null);
}
}"
`;
exports[`t-props child receives a copy of the t-props object, not the original 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
let block1 = createBlock(\`<div/>\`);
return function template(ctx, node, key = \\"\\") {
return block1();
}
}"
`;
2021-10-20 15:25:32 +02:00
exports[`t-props t-props and other props 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2021-10-20 15:25:32 +02:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Comp\`, true, false, true, false);
2021-10-20 15:25:32 +02:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<div><div><block-child-0/></div></div>\`);
2021-10-20 15:25:32 +02:00
return function template(ctx, node, key = \\"\\") {
const b2 = comp1(Object.assign({}, ctx['state1'], {a: ctx['a']}), key + \`__1\`, node, this, null);
2021-12-20 11:19:59 +01:00
return block1([], [b2]);
2021-10-20 15:25:32 +02:00
}
}"
`;
exports[`t-props t-props and other props 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2021-10-20 15:25:32 +02:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2021-10-20 15:25:32 +02:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<div><block-text-0/><block-text-1/></div>\`);
2021-10-20 15:25:32 +02:00
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].a;
let txt2 = ctx['props'].b;
return block1([txt1, txt2]);
2021-10-20 15:25:32 +02:00
}
}"
`;
exports[`t-props t-props only 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2021-10-20 15:25:32 +02:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Comp\`, true, false, true, false);
2021-10-20 15:25:32 +02:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<div><div><block-child-0/></div></div>\`);
2021-10-20 15:25:32 +02:00
return function template(ctx, node, key = \\"\\") {
const b2 = comp1(Object.assign({}, ctx['state']), key + \`__1\`, node, this, null);
2021-12-20 11:19:59 +01:00
return block1([], [b2]);
2021-10-20 15:25:32 +02:00
}
}"
`;
exports[`t-props t-props only 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2021-10-20 15:25:32 +02:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2021-10-20 15:25:32 +02:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<div><block-text-0/></div>\`);
2021-10-20 15:25:32 +02:00
return function template(ctx, node, key = \\"\\") {
let txt1 = ctx['props'].a;
return block1([txt1]);
2021-10-20 15:25:32 +02:00
}
}"
`;
2021-11-13 17:10:06 +01:00
exports[`t-props t-props with props 1`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2021-11-13 17:10:06 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
const comp1 = app.createComponent(\`Child\`, true, false, true, false);
2021-11-13 17:10:06 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<div><block-child-0/></div>\`);
2021-11-13 17:10:06 +01:00
return function template(ctx, node, key = \\"\\") {
const b2 = comp1(Object.assign({}, ctx['childProps'], {a: 1,b: 2}), key + \`__1\`, node, this, null);
2021-12-20 11:19:59 +01:00
return block1([], [b2]);
2021-11-13 17:10:06 +01:00
}
}"
`;
exports[`t-props t-props with props 2`] = `
2022-05-26 15:09:09 +02:00
"function anonymous(app, bdom, helpers
2021-11-13 17:10:06 +01:00
) {
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
2021-11-13 17:10:06 +01:00
2021-12-20 11:19:59 +01:00
let block1 = createBlock(\`<div/>\`);
2021-11-13 17:10:06 +01:00
return function template(ctx, node, key = \\"\\") {
2021-12-20 11:19:59 +01:00
return block1();
2021-11-13 17:10:06 +01:00
}
}"
`;