mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] qweb: add better support for template with only strings
This commit is contained in:
@@ -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>");
|
||||
|
||||
Reference in New Issue
Block a user