[FIX] slots: allow t-call and components in slot default content

This commit is contained in:
Samuel Degueldre
2021-11-24 14:13:09 +01:00
committed by Géry Debongnie
parent 840348892f
commit 92174559a1
4 changed files with 133 additions and 23 deletions
+29
View File
@@ -1434,4 +1434,33 @@ describe("slots", () => {
}
expect(error).toBeNull();
});
test("can use t-call in default-content of t-slot", async () => {
const template = xml``;
class Child extends Component {
static template = xml`<t t-slot="default"><t t-call="${template}"/></t>`;
}
class Parent extends Component {
static template = xml`<Child/>`;
static components = { Child };
}
await mount(Parent, fixture);
});
test("can use component in default-content of t-slot", async () => {
class GrandChild extends Component {
static template = xml``;
}
class Child extends Component {
static template = xml`<t t-slot="default"><GrandChild/></t>`;
static components = { GrandChild };
}
class Parent extends Component {
static template = xml`<Child/>`;
static components = { Child };
}
await mount(Parent, fixture);
});
});