[FIX] qweb: add better support for template with only strings

This commit is contained in:
Géry Debongnie
2019-06-12 11:36:36 +02:00
parent 4c41f62364
commit 45a2b0122d
4 changed files with 50 additions and 6 deletions
+10
View File
@@ -24,6 +24,16 @@ describe("static templates", () => {
expect(renderToString(qweb, "test")).toBe("hello vdom");
});
test("simple dynamic value", () => {
qweb.addTemplate("test", "<t><t t-esc=\"text\"/></t>");
expect(renderToString(qweb, "test", {text: "hello vdom"})).toBe("hello vdom");
});
test("simple string, with some dynamic value", () => {
qweb.addTemplate("test", "<t>hello <t t-esc=\"text\"/></t>");
expect(renderToString(qweb, "test", {text: "vdom"})).toBe("hello vdom");
});
test("empty div", () => {
qweb.addTemplate("test", "<div></div>");
expect(renderToString(qweb, "test")).toBe("<div></div>");