mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
b1a3b322ee
Before this commit, the App destroy method would not destroy everything synchronously. The code scheduled a flush, which is asynchronous, to finally clean up the task lists, and destroy the cancelled nodes. But this is not really good for tests: we need a stronger guarantee that nothing will happen after the destroy. With this commit, we simply call the processTask method immediately after destroying the root component, so all cancelled nodes will be destroyed immediately.
99 lines
2.6 KiB
Plaintext
99 lines
2.6 KiB
Plaintext
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
exports[`app App supports env with getters/setters 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div><block-text-0/> <block-text-1/></div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let txt1 = ctx['env'].someVal;
|
|
let txt2 = Object.keys(ctx['env'].services);
|
|
return block1([txt1, txt2]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
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 = \\"\\") {
|
|
let b2,b3;
|
|
b2 = text(\`A\`);
|
|
if (ctx['state'].value) {
|
|
b3 = comp1({}, key + \`__1\`, node, this, null);
|
|
}
|
|
return multi([b2, b3]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`app app: clear scheduler tasks and destroy cancelled nodes immediately on destroy 2`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
return text(\`B\`);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`app can configure an app with props 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let txt1 = ctx['props'].value;
|
|
return block1([txt1]);
|
|
}
|
|
}"
|
|
`;
|
|
|
|
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();
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`app destroy remove the widget from the DOM 1`] = `
|
|
"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();
|
|
}
|
|
}"
|
|
`;
|
|
|
|
exports[`app warnIfNoStaticProps works as expected 1`] = `
|
|
"function anonymous(app, bdom, helpers
|
|
) {
|
|
let { text, createBlock, list, multi, html, toggler, comment } = bdom;
|
|
|
|
let block1 = createBlock(\`<div><block-text-0/></div>\`);
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
let txt1 = ctx['message'];
|
|
return block1([txt1]);
|
|
}
|
|
}"
|
|
`;
|