mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
+8
-1
@@ -893,11 +893,18 @@ describe("t-on", () => {
|
||||
|
||||
describe("t-ref", () => {
|
||||
test("can get a ref on a node", () => {
|
||||
qweb.addTemplate("test", `<div><span t-ref="myspan"/></div>`);
|
||||
qweb.addTemplate("test", `<div><span t-ref="'myspan'"/></div>`);
|
||||
let refs: any = {};
|
||||
renderToDOM(qweb, "test", { refs });
|
||||
expect(refs.myspan.tagName).toBe("SPAN");
|
||||
});
|
||||
|
||||
test("can get a dynamic ref on a node", () => {
|
||||
qweb.addTemplate("test", `<div><span t-ref="'myspan' + 3"/></div>`);
|
||||
let refs: any = {};
|
||||
renderToDOM(qweb, "test", { refs });
|
||||
expect(refs.myspan3.tagName).toBe("SPAN");
|
||||
});
|
||||
});
|
||||
|
||||
describe("loading templates", () => {
|
||||
|
||||
Reference in New Issue
Block a user