[FIX] re-introduce tests

This commit is contained in:
Lucas Perais (lpe)
2021-10-18 17:52:25 +02:00
committed by Aaron Bohy
parent d569ea1c28
commit 10df0b5f4a
17 changed files with 616 additions and 79 deletions
+20 -2
View File
@@ -126,7 +126,7 @@ describe("simple templates, mostly static", () => {
describe("loading templates", () => {
test.skip("can initialize qweb with a string", () => {
/* const templates = `<?xml version="1.0" encoding="UTF-8"?>
/* const templates = `<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<div t-name="hey">jupiler</div>
</templates>`;
@@ -152,4 +152,22 @@ describe("loading templates", () => {
qweb.addTemplates(data);
expect(Object.keys(qweb.templates)).toEqual([]);*/
});
});
});
describe("global template registration", () => {
test.skip("can register template globally", () => {
// expect.assertions(5);
// let qweb = new QWeb();
// try {
// qweb.render("mytemplate");
// } catch (e) {
// expect(e.message).toMatch("Template mytemplate does not exist");
// }
// expect(qweb.templates.mytemplate).toBeUndefined();
// QWeb.registerTemplate("mytemplate", "<div>global</div>");
// expect(qweb.templates.mytemplate).toBeDefined();
// const vnode = qweb.render("mytemplate");
// expect(vnode.sel).toBe("div");
// expect((vnode as any).children[0].text).toBe("global");
});
});