2020-11-26 16:45:25 +01:00
|
|
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
|
|
2021-12-02 12:48:34 +01:00
|
|
|
exports[`app App supports env with getters/setters 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-12-02 12:48:34 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-02 12:48:34 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-text-0/> <block-text-1/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['env'].someVal;
|
|
|
|
|
let txt2 = Object.keys(ctx['env'].services);
|
|
|
|
|
return block1([txt1, txt2]);
|
2021-12-02 12:48:34 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2023-07-19 16:54:56 +02:00
|
|
|
exports[`app app: clear scheduler tasks and destroy cancelled nodes immediately on destroy 1`] = `
|
|
|
|
|
"function anonymous(app, bdom, helpers
|
|
|
|
|
) {
|
|
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
|
const comp1 = app.createComponent(\`B\`, true, false, false, []);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2023-08-04 08:49:08 +02:00
|
|
|
let b2, b3;
|
2023-07-19 16:54:56 +02:00
|
|
|
b2 = text(\`A\`);
|
|
|
|
|
if (ctx['state'].value) {
|
|
|
|
|
b3 = comp1({}, key + \`__1\`, node, this, null);
|
|
|
|
|
}
|
|
|
|
|
return multi([b2, b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2023-09-29 13:28:14 +02:00
|
|
|
exports[`app app: clear scheduler tasks and destroy cancelled nodes immediately on destroy 3`] = `
|
2023-07-19 16:54:56 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
|
|
|
|
) {
|
|
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
return text(\`B\`);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2021-12-20 17:32:32 +01:00
|
|
|
exports[`app can configure an app with props 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2021-12-20 17:32:32 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2021-12-20 17:32:32 +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'].value;
|
|
|
|
|
return block1([txt1]);
|
2021-12-20 17:32:32 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2023-11-29 11:37:56 +01:00
|
|
|
exports[`app can load templates from an object name-string 1`] = `
|
|
|
|
|
"function anonymous(app, bdom, helpers
|
|
|
|
|
) {
|
|
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div class=\\"hello\\">hello</div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
return block1();
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2022-08-17 08:01:23 +02:00
|
|
|
exports[`app can mount app in an iframe 1`] = `
|
|
|
|
|
"function anonymous(app, bdom, helpers
|
|
|
|
|
) {
|
|
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div class=\\"my-div\\"/>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
return block1();
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2020-11-26 16:45:25 +01:00
|
|
|
exports[`app destroy remove the widget from the DOM 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2020-11-26 16:45:25 +01:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div/>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
return block1();
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
2022-05-22 11:15:57 +02:00
|
|
|
|
|
|
|
|
exports[`app warnIfNoStaticProps works as expected 1`] = `
|
2022-05-26 15:09:09 +02:00
|
|
|
"function anonymous(app, bdom, helpers
|
2022-05-22 11:15:57 +02:00
|
|
|
) {
|
2022-06-08 11:09:39 +02:00
|
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
2022-05-22 11:15:57 +02:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
let txt1 = ctx['message'];
|
|
|
|
|
return block1([txt1]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|