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
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
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 = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
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
|
|
|
) {
|
2022-06-08 11:09:39 +02: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 = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['props'].a+ctx['props'].b;
|
|
|
|
|
return block1([txt1]);
|
2021-11-13 17:10:06 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2022-01-27 12:58:04 +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
|
2022-01-27 12:58:04 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, false, true, false);
|
2022-01-27 12:58:04 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
return comp1(Object.assign({}, ctx['childProps']), key + \`__1\`, node, this, null);
|
2022-01-27 12:58:04 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
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
|
2022-01-27 12:58:04 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-27 12:58:04 +01:00
|
|
|
|
|
|
|
|
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
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
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 = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
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
|
|
|
) {
|
2022-06-08 11:09:39 +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 = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
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
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
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 = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
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
|
|
|
) {
|
2022-06-08 11:09:39 +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 = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
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
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-06-09 14:55:57 +02:00
|
|
|
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 = \\"\\") {
|
2022-06-22 15:39:31 +02:00
|
|
|
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
|
|
|
) {
|
2022-06-08 11:09:39 +02: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
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|