[IMP] *: re-add a bunch of tests

This commit is contained in:
Samuel Degueldre
2021-10-21 10:13:08 +02:00
committed by Aaron Bohy
parent b6eb4d009e
commit ced5d0f69f
19 changed files with 1525 additions and 279 deletions
+15
View File
@@ -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", () => {