2020-11-26 16:45:25 +01:00
|
|
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
|
|
|
|
2021-11-10 08:18:25 +01:00
|
|
|
exports[`refs basic use 1`] = `
|
|
|
|
|
"function anonymous(bdom, helpers
|
|
|
|
|
) {
|
2021-11-29 13:22:04 +01:00
|
|
|
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
2021-11-10 08:18:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div block-ref=\\"0\\"/>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
const refs = ctx.__owl__.refs;
|
|
|
|
|
let d1 = (el) => refs[\`div\`] = el;
|
|
|
|
|
return block1([d1]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
2020-11-26 16:45:25 +01:00
|
|
|
exports[`refs refs are properly bound in slots 1`] = `
|
|
|
|
|
"function anonymous(bdom, helpers
|
|
|
|
|
) {
|
2021-11-29 13:22:04 +01:00
|
|
|
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
2021-12-01 17:03:53 +01:00
|
|
|
let { capture } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<div><span class=\\"counter\\"><block-text-0/></span><block-child-0/></div>\`);
|
|
|
|
|
let block2 = createBlock(\`<button block-handler-0=\\"click\\" block-ref=\\"1\\">do something</button>\`);
|
|
|
|
|
|
2021-12-22 12:33:17 +01:00
|
|
|
function slot1(ctx, node, key = \\"\\") {
|
2021-11-25 14:50:40 +01:00
|
|
|
const refs = ctx.__owl__.refs;
|
2021-12-22 12:33:17 +01:00
|
|
|
let hdlr1 = [ctx['doSomething'], ctx];
|
|
|
|
|
let d1 = (el) => refs[\`myButton\`] = el;
|
|
|
|
|
return block2([hdlr1, d1]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-12-22 11:33:12 +01:00
|
|
|
let txt1 = ctx['state'].val;
|
2021-11-19 13:43:21 +01:00
|
|
|
const ctx1 = capture(ctx);
|
2021-12-22 12:33:17 +01:00
|
|
|
let b3 = component(\`Dialog\`, {slots: {'footer': {__render: slot1, __ctx: ctx1}}}, key + \`__1\`, node, ctx);
|
2021-12-22 11:33:12 +01:00
|
|
|
return block1([txt1], [b3]);
|
2020-11-26 16:45:25 +01:00
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
2021-12-20 11:19:59 +01:00
|
|
|
|
|
|
|
|
exports[`refs refs are properly bound in slots 2`] = `
|
|
|
|
|
"function anonymous(bdom, helpers
|
|
|
|
|
) {
|
|
|
|
|
let { text, createBlock, list, multi, html, toggler, component, comment } = bdom;
|
|
|
|
|
let { callSlot } = helpers;
|
|
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
let b2 = callSlot(ctx, node, key, 'footer', false, {});
|
|
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|