mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
support using object variables in t-esc
This commit is contained in:
+3
-6
@@ -410,14 +410,11 @@ describe("attributes", () => {
|
||||
expect(result).toBe('<div><span class="def"></span></div>');
|
||||
});
|
||||
|
||||
test.skip("from object variables set previously", () => {
|
||||
// qweb is stupid and does not support this.
|
||||
// To do that properly, we need to extend the formatExpression method to
|
||||
// be able to deal with objects. I think that it is not easy:
|
||||
// it should properly deal with stuff like {a:expr, b: {c: otherexpr}}
|
||||
test("from object variables set previously", () => {
|
||||
// Note: standard qweb does not allow this...
|
||||
qweb.addTemplate(
|
||||
"test",
|
||||
`<div t-debug="1"><t t-set="o" t-value="{a:'b'}"/><span t-att-class="o.a"/></div>`
|
||||
`<div><t t-set="o" t-value="{a:'b'}"/><span t-att-class="o.a"/></div>`
|
||||
);
|
||||
const result = renderToString(qweb, "test");
|
||||
expect(result).toBe('<div><span class="b"></span></div>');
|
||||
|
||||
Reference in New Issue
Block a user