[FIX] compiler: add support for #{...} in string interpolation

This commit is contained in:
Géry Debongnie
2022-06-07 17:25:23 +02:00
committed by Sam Degueldre
parent a3111eb9ca
commit 385e118e58
7 changed files with 68 additions and 14 deletions
+9
View File
@@ -27,6 +27,15 @@ describe("t-ref", () => {
expect(refs.myspan3.tagName).toBe("SPAN");
});
test("can get a dynamic ref on a node, alternate syntax", () => {
const template = `<div><span t-ref="myspan#{id}"/></div>`;
const refs: any = {};
const bdom = renderToBdom(template, { id: 3, __owl__: { refs } });
expect(refs).toEqual({});
mount(bdom, document.createElement("div"));
expect(refs.myspan3.tagName).toBe("SPAN");
});
test("refs in a loop", () => {
const template = `<div>
<t t-foreach="items" t-as="item" t-key="item">