2021-11-04 13:46:49 +01:00
|
|
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
|
|
|
|
|
|
exports[`t-key t-foreach with t-key switch component position 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-04 13:46:49 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { prepareList, withKey } = helpers;
|
2022-06-09 14:55:57 +02:00
|
|
|
const comp1 = app.createComponent(\`Child\`, true, false, false, false);
|
2021-11-04 13:46:49 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
ctx = Object.create(ctx);
|
2022-03-06 10:27:07 +01:00
|
|
|
const [k_block2, v_block2, l_block2, c_block2] = prepareList(ctx['clist']);;
|
2021-11-04 13:46:49 +01:00
|
|
|
for (let i1 = 0; i1 < l_block2; i1++) {
|
|
|
|
|
ctx[\`c\`] = v_block2[i1];
|
2022-03-06 10:27:07 +01:00
|
|
|
const key1 = ctx['c'];
|
2021-11-04 13:46:49 +01:00
|
|
|
const tKey_1 = ctx['key1'];
|
2022-06-22 15:39:31 +02:00
|
|
|
c_block2[i1] = withKey(comp1({key: ctx['c']+ctx['key1']}, tKey_1 + key + \`__1__\${key1}\`, node, this, null), tKey_1 + key1);
|
2021-11-04 13:46:49 +01:00
|
|
|
}
|
2022-03-06 10:27:07 +01:00
|
|
|
const b2 = list(c_block2);
|
2021-11-04 13:46:49 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`t-key t-foreach with t-key switch component position 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-04 13:46:49 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-04 13:46:49 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['props'].key;
|
|
|
|
|
return block1([txt1]);
|
2021-11-04 13:46:49 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`t-key t-key on Component 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-04 13:46:49 +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, false, false);
|
2021-11-04 13:46:49 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
const tKey_1 = ctx['key'];
|
2022-06-22 15:39:31 +02:00
|
|
|
return toggler(tKey_1, comp1({key: ctx['key']}, tKey_1 + key + \`__1\`, node, this, null));
|
2021-11-04 13:46:49 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`t-key t-key on Component 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-04 13:46:49 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-04 13:46:49 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['props'].key;
|
|
|
|
|
return block1([txt1]);
|
2021-11-04 13:46:49 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`t-key t-key on Component as a function 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-04 13:46:49 +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, false, false);
|
2021-11-04 13:46:49 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
const tKey_1 = ctx['key'];
|
2022-06-22 15:39:31 +02:00
|
|
|
const b2 = toggler(tKey_1, comp1({key: ctx['key']}, tKey_1 + key + \`__1\`, node, this, null));
|
2021-11-04 13:46:49 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`t-key t-key on Component as a function 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-04 13:46:49 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-04 13:46:49 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['props'].key;
|
|
|
|
|
return block1([txt1]);
|
2021-11-04 13:46:49 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`t-key t-key on multiple Components 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-04 13:46:49 +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, false, false);
|
|
|
|
|
const comp2 = app.createComponent(\`Child\`, true, false, false, false);
|
2021-11-04 13:46:49 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<span><block-child-0/><block-child-1/></span>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
const tKey_1 = ctx['key1'];
|
2022-06-22 15:39:31 +02:00
|
|
|
const b2 = toggler(tKey_1, comp1({key: ctx['key1']}, tKey_1 + key + \`__1\`, node, this, null));
|
2021-12-22 12:33:17 +01:00
|
|
|
const tKey_2 = ctx['key2'];
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = toggler(tKey_2, comp2({key: ctx['key2']}, tKey_2 + key + \`__2\`, node, this, null));
|
2021-11-04 13:46:49 +01:00
|
|
|
return block1([], [b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`t-key t-key on multiple Components 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-04 13:46:49 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-04 13:46:49 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['props'].key;
|
|
|
|
|
return block1([txt1]);
|
2021-11-04 13:46:49 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`t-key t-key on multiple Components with t-call 1 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-04 13:46:49 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-05-26 15:09:09 +02:00
|
|
|
let { isBoundary, withDefault, setContextValue } = helpers;
|
|
|
|
|
const callTemplate_1 = app.getTemplate(\`calledTemplate\`);
|
|
|
|
|
const callTemplate_2 = app.getTemplate(\`calledTemplate\`);
|
2021-11-04 13:46:49 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<span><block-child-0/><block-child-1/></span>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
ctx = Object.create(ctx);
|
|
|
|
|
ctx[isBoundary] = 1
|
|
|
|
|
ctx = Object.create(ctx);
|
|
|
|
|
ctx[isBoundary] = 1;
|
|
|
|
|
setContextValue(ctx, \\"key\\", ctx['key1']);
|
2022-03-06 10:27:07 +01:00
|
|
|
const b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
2021-11-04 13:46:49 +01:00
|
|
|
ctx = ctx.__proto__;
|
|
|
|
|
ctx = Object.create(ctx);
|
|
|
|
|
ctx[isBoundary] = 1;
|
|
|
|
|
setContextValue(ctx, \\"key\\", ctx['key2']);
|
2022-03-06 10:27:07 +01:00
|
|
|
const b3 = callTemplate_2.call(this, ctx, node, key + \`__2\`);
|
2021-11-04 13:46:49 +01:00
|
|
|
return block1([], [b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`t-key t-key on multiple Components with t-call 1 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-12-20 11:19:59 +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, false, false);
|
2021-12-20 11:19:59 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
const tKey_1 = ctx['key'];
|
2022-06-22 15:39:31 +02:00
|
|
|
return toggler(tKey_1, comp1({key: ctx['key']}, tKey_1 + key + \`__1\`, node, this, null));
|
2021-12-20 11:19:59 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`t-key t-key on multiple Components with t-call 1 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-04 13:46:49 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-04 13:46:49 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['props'].key;
|
|
|
|
|
return block1([txt1]);
|
2021-11-04 13:46:49 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
exports[`t-key t-key on multiple Components with t-call 2 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-12-20 11:19:59 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-05-26 15:09:09 +02:00
|
|
|
const callTemplate_1 = app.getTemplate(\`calledTemplate\`);
|
2021-12-20 11:19:59 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2022-03-06 10:27:07 +01:00
|
|
|
const b2 = callTemplate_1.call(this, ctx, node, key + \`__1\`);
|
2021-12-20 11:19:59 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-11-04 13:46:49 +01:00
|
|
|
exports[`t-key t-key on multiple Components with t-call 2 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-04 13:46:49 +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, false, false);
|
|
|
|
|
const comp2 = app.createComponent(\`Child\`, true, false, false, false);
|
2021-11-04 13:46:49 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
const tKey_1 = ctx['key1'];
|
2022-06-22 15:39:31 +02:00
|
|
|
const b2 = toggler(tKey_1, comp1({key: ctx['key1']}, tKey_1 + key + \`__1\`, node, this, null));
|
2021-12-22 12:33:17 +01:00
|
|
|
const tKey_2 = ctx['key2'];
|
2022-06-22 15:39:31 +02:00
|
|
|
const b3 = toggler(tKey_2, comp2({key: ctx['key2']}, tKey_2 + key + \`__2\`, node, this, null));
|
2021-11-04 13:46:49 +01:00
|
|
|
return multi([b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`t-key t-key on multiple Components with t-call 2 3`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-11-04 13:46:49 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-11-04 13:46:49 +01:00
|
|
|
|
2021-12-20 11:19:59 +01:00
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
2021-11-04 13:46:49 +01:00
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['props'].key;
|
|
|
|
|
return block1([txt1]);
|
2021-11-04 13:46:49 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|