mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] qweb: do not capture current qweb instance in closure
it is not needed, and has a bad effect on globally registered templates.
This commit is contained in:
@@ -662,6 +662,14 @@ describe("t-call (template calling", () => {
|
||||
const recursiveFn = Object.values(qweb.recursiveFns)[0];
|
||||
expect(recursiveFn.toString()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test("t-call, global templates", () => {
|
||||
QWeb.registerTemplate('abcd', '<div><t t-call="john"/></div>')
|
||||
qweb.addTemplate("john", `<span>desk</span>`);
|
||||
const expected = "<div><span>desk</span></div>";
|
||||
expect(trim(renderToString(qweb, "abcd"))).toBe(expected);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
describe("foreach", () => {
|
||||
|
||||
Reference in New Issue
Block a user