[IMP] qweb: add support for template strings

in inline expressions, such as t-esc or t-value.

closes #746
This commit is contained in:
Géry Debongnie
2021-07-04 09:27:31 +02:00
committed by aab-odoo
parent 17ae1d06c4
commit a1552117f9
5 changed files with 88 additions and 2 deletions
+6
View File
@@ -206,4 +206,10 @@ describe("expression evaluation", () => {
expect(compileExpr("{a,b}", {})).toBe("{a:scope['a'],b:scope['b']}");
expect(compileExpr("{a,b:3,c}", {})).toBe("{a:scope['a'],b:3,c:scope['c']}");
});
test("template strings", () => {
expect(compileExpr("`hey`", {})).toBe("`hey`");
expect(compileExpr("`hey ${you}`", {})).toBe("`hey ${scope['you']}`");
expect(compileExpr("`hey ${1 + 2}`", {})).toBe("`hey ${1+2}`");
});
});