[REF] initial prototype of owl 2

This commit is contained in:
Géry Debongnie
2020-11-26 16:45:25 +01:00
parent 4e3b7c74da
commit 7ac20f4fc2
187 changed files with 29162 additions and 32486 deletions
+29
View File
@@ -0,0 +1,29 @@
import { renderToString, snapshotEverything } from "../helpers";
snapshotEverything();
// -----------------------------------------------------------------------------
// comments
// -----------------------------------------------------------------------------
describe("comments", () => {
test("properly handle comments", () => {
const template = `<div>hello <!-- comment-->owl</div>`;
expect(renderToString(template)).toBe("<div>hello <!-- comment-->owl</div>");
});
test("only a comment", () => {
const template = `<!-- comment-->`;
expect(renderToString(template)).toBe(`<!-- comment-->`);
});
test("properly handle comments between t-if/t-else", () => {
const template = `
<div>
<span t-if="true">true</span>
<!-- comment-->
<span t-else="">owl</span>
</div>`;
expect(renderToString(template)).toBe("<div><span>true</span></div>");
});
});