[FIX][BREAKING] t-esc on component is not supported anymore

This commit is contained in:
Lucas Perais (lpe)
2021-11-15 15:00:46 +01:00
committed by Aaron Bohy
parent db93ef08ff
commit 1761af9c24
4 changed files with 4 additions and 62 deletions
@@ -1137,41 +1137,6 @@ exports[`slots slot and (inline) t-call 3`] = `
}"
`;
exports[`slots slot and (inline) t-esc 1`] = `
"function anonymous(bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component } = bdom;
let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers;
let block1 = createBlock(\`<span><block-child-0/></span>\`);
return function template(ctx, node, key = \\"\\") {
let b2 = callSlot(ctx, node, key, 'default');
return block1([], [b2]);
}
}"
`;
exports[`slots slot and (inline) t-esc 2`] = `
"function anonymous(bdom, helpers
) {
let { text, createBlock, list, multi, html, toggler, component } = bdom;
let { withDefault, getTemplate, prepareList, withKey, zero, call, callSlot, capture, isBoundary, shallowEqual, setContextValue, toNumber } = helpers;
let assign = Object.assign;
let block1 = createBlock(\`<div><block-child-0/></div>\`);
const slot2 = ctx => (node, key) => {
return text('toph');
}
return function template(ctx, node, key = \\"\\") {
let b3 = assign(component(\`Dialog\`, {}, key + \`__1\`, node, ctx), {slots: {'default': slot2(ctx)}});
return block1([], [b3]);
}
}"
`;
exports[`slots slot and t-call 1`] = `
"function anonymous(bdom, helpers
) {
-13
View File
@@ -1162,19 +1162,6 @@ describe("slots", () => {
expect(fixture.innerHTML).toBe("<div><span>toph</span></div>");
});
test("slot and (inline) t-esc", async () => {
class Dialog extends Component {
static template = xml`<span><t t-slot="default"/></span>`;
}
class Parent extends Component {
static template = xml`<div><Dialog t-esc="'toph'"/></div>`;
static components = { Dialog };
}
await mount(Parent, fixture);
expect(fixture.innerHTML).toBe("<div><span>toph</span></div>");
});
test("slot and t-call", async () => {
let sokka = xml`<p>sokka</p>`;
class Dialog extends Component {