[IMP] parser: normalize document before parsing

This commit is contained in:
Samuel Degueldre
2021-11-24 10:56:21 +01:00
committed by Aaron Bohy
parent 2943ca3921
commit 6459d8d289
2 changed files with 92 additions and 30 deletions
+8 -2
View File
@@ -1259,8 +1259,14 @@ describe("qweb parser", () => {
});
test("component with t-esc", async () => {
expect(() => parse(`<MyComponent t-esc="someValue"/>`)).toThrow(
"t-esc is not supported on Component nodes"
expect(parse(`<MyComponent t-esc="someValue"/>`)).toEqual(
parse(`<MyComponent><t t-esc="someValue"/></MyComponent>`)
);
});
test("component with t-esc and content", async () => {
expect(() => parse(`<MyComponent t-esc="someValue">Some content</MyComponent>`)).toThrow(
"Cannot have t-esc on a component that already has content"
);
});