mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
2b5cea944b
This commit removes an AST change during the code generation of slots. Before, the `compileTSlot` function deleted the `t-props` attribute directly on `ast.attrs`. This creates wrong code when compiling a second time as the `t-props` attribute does not exist anymore.
16 lines
506 B
TypeScript
16 lines
506 B
TypeScript
import { parseXML } from "../../src/common/utils";
|
|
import { compile } from "../../src/compiler";
|
|
|
|
describe("t-slot", () => {
|
|
test("compile t-props correctly multiple time", () => {
|
|
const template = `<t t-slot="default" t-props="{ a: 1 }"/>`;
|
|
const parsedTemplate = parseXML(template).firstChild as Element;
|
|
|
|
const fn1 = compile(parsedTemplate);
|
|
expect(fn1.toString()).toMatchSnapshot();
|
|
|
|
const fn2 = compile(parsedTemplate);
|
|
expect(fn2.toString()).toBe(fn1.toString());
|
|
});
|
|
});
|