mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[IMP] *: re-add a bunch of tests
This commit is contained in:
committed by
Aaron Bohy
parent
b6eb4d009e
commit
ced5d0f69f
@@ -122,6 +122,21 @@ describe("simple templates, mostly static", () => {
|
||||
const template = `<tr><td>cell</td></tr>`;
|
||||
expect(renderToString(template)).toBe(template);
|
||||
});
|
||||
|
||||
test("inline template string in t-esc", () => {
|
||||
const template = '<t><t t-esc="`text`"/></t>';
|
||||
expect(renderToString(template)).toBe("text");
|
||||
});
|
||||
|
||||
test("inline template string with content in t-esc", () => {
|
||||
const template = '<t><t t-set="v" t-value="1"/><t t-esc="`text${v}`"/></t>';
|
||||
expect(renderToString(template)).toBe("text1");
|
||||
});
|
||||
|
||||
test("inline template string with variable in context", () => {
|
||||
const template = '<t><t t-esc="`text ${v}`"/></t>';
|
||||
expect(renderToString(template, { v: "from context" })).toBe("text from context");
|
||||
});
|
||||
});
|
||||
|
||||
describe("loading templates", () => {
|
||||
|
||||
Reference in New Issue
Block a user