[FIX] qweb: fix crash with ref an component in same slot

This commit is contained in:
Samuel Degueldre
2021-11-10 09:13:17 +01:00
committed by Géry Debongnie
parent c718d8e6c6
commit 3e70b17da1
4 changed files with 55 additions and 2 deletions
+18
View File
@@ -1347,4 +1347,22 @@ describe("slots", () => {
expect(error).toBeNull();
expect(fixture.innerHTML).toEqual("");
});
test("can render node with t-ref and Component in same slot", async () => {
class Child extends Component {
static template = xml`<t t-slot="default"/>`;
}
class Parent extends Component {
static template = xml`<Child><div t-ref="div"/><Child/></Child>`;
static components = { Child };
}
let error = null;
try {
await mount(Parent, fixture);
} catch (e) {
error = e;
}
expect(error).toBeNull();
});
});