2021-10-26 09:48:31 +02:00
|
|
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
|
|
|
|
|
|
exports[`t-key can use t-key directive on a node 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-10-26 09:48:31 +02:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-10-26 09:48:31 +02:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-11-04 13:46:49 +01:00
|
|
|
const tKey_1 = ctx['beer'].id;
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['beer'].name;
|
|
|
|
|
return toggler(tKey_1, block1([txt1]));
|
2021-11-04 13:46:49 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`t-key can use t-key directive on a node 2 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-11-04 13:46:49 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
const tKey_1 = ctx['beer'].id;
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['beer'].name;
|
|
|
|
|
return toggler(tKey_1, block1([txt1]));
|
2021-11-04 13:46:49 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`t-key can use t-key directive on a node 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;
|
2021-11-04 13:46:49 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
const tKey_1 = ctx['getKey'](ctx['beer']);
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['beer'].name;
|
|
|
|
|
return toggler(tKey_1, block1([txt1]));
|
2021-10-26 09:48:31 +02:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`t-key t-key directive in a list 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-10-26 09:48:31 +02: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;
|
2021-10-26 09:48:31 +02:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<ul><block-child-0/></ul>\`);
|
|
|
|
|
let block3 = createBlock(\`<li><block-text-0/></li>\`);
|
|
|
|
|
|
|
|
|
|
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['beers']);;
|
2021-10-26 09:48:31 +02:00
|
|
|
for (let i1 = 0; i1 < l_block2; i1++) {
|
2023-08-02 07:55:58 +02:00
|
|
|
ctx[\`beer\`] = k_block2[i1];
|
2022-03-06 10:27:07 +01:00
|
|
|
const key1 = ctx['beer'].id;
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['beer'].name;
|
|
|
|
|
c_block2[i1] = withKey(block3([txt1]), key1);
|
2021-10-26 09:48:31 +02:00
|
|
|
}
|
2022-03-06 10:27:07 +01:00
|
|
|
const b2 = list(c_block2);
|
2021-10-26 09:48:31 +02:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
2022-01-20 16:26:05 +01:00
|
|
|
|
|
|
|
|
exports[`t-key t-key on sub dom node pushes a child block in its parent 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-01-20 16:26:05 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-20 16:26:05 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-child-0/><block-child-1/></div>\`);
|
|
|
|
|
let block2 = createBlock(\`<span/>\`);
|
|
|
|
|
let block3 = createBlock(\`<div><h1/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2023-08-04 08:49:08 +02:00
|
|
|
let b2, b3;
|
2022-01-20 16:26:05 +01:00
|
|
|
if (ctx['hasSpan']) {
|
|
|
|
|
b2 = block2();
|
|
|
|
|
}
|
|
|
|
|
const tKey_1 = ctx['key'];
|
|
|
|
|
b3 = toggler(tKey_1, block3());
|
|
|
|
|
return block1([], [b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`t-key t-key on sub dom node pushes a child block in its parent 2`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-01-20 16:26:05 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-01-20 16:26:05 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><h1/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
const tKey_1 = ctx['key'];
|
|
|
|
|
return toggler(tKey_1, block1());
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|