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 { callSlot } = helpers;
|
2020-11-26 16:45:25 +01:00
|
|
|
|
|
|
|
|
let block1 = createBlock(\`<span><block-child-0/></span>\`);
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
2021-11-19 13:43:21 +01:00
|
|
|
let b2 = callSlot(ctx, node, key, 'footer', false, {});
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([], [b2]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
exports[`refs refs are properly bound in slots 2`] = `
|
|
|
|
|
"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-11-25 14:50:40 +01:00
|
|
|
function slot2(ctx, node, key = \\"\\") {
|
|
|
|
|
const refs = ctx.__owl__.refs;
|
2021-11-22 12:04:58 +01:00
|
|
|
let d2 = [ctx['doSomething'], ctx];
|
2020-11-26 16:45:25 +01:00
|
|
|
let d3 = (el) => refs[\`myButton\`] = el;
|
|
|
|
|
return block2([d2, d3]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return function template(ctx, node, key = \\"\\") {
|
|
|
|
|
let d1 = ctx['state'].val;
|
2021-11-19 13:43:21 +01:00
|
|
|
const ctx1 = capture(ctx);
|
|
|
|
|
let b3 = component(\`Dialog\`, {slots: {'footer': {__render: slot2, __ctx: ctx1}}}, key + \`__3\`, node, ctx);
|
2020-11-26 16:45:25 +01:00
|
|
|
return block1([d1], [b3]);
|
|
|
|
|
}
|
|
|
|
|
}"
|
|
|
|
|
`;
|