mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
add loadtemplates method to qweb
This commit is contained in:
@@ -679,3 +679,19 @@ describe("t-ref", () => {
|
||||
expect(refs.myspan.tagName).toBe("SPAN");
|
||||
});
|
||||
});
|
||||
|
||||
describe("loading templates", () => {
|
||||
test("can load a few templates from a xml string", () => {
|
||||
const data = `
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates id="template" xml:space="preserve">
|
||||
|
||||
<t t-name="items"><li>ok</li><li>foo</li></t>
|
||||
|
||||
<ul t-name="main"><t t-call="items"/></ul>
|
||||
</templates>`;
|
||||
qweb.loadTemplates(data);
|
||||
const result = renderToString(qweb, "main");
|
||||
expect(result).toBe("<ul><li>ok</li><li>foo</li></ul>");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user