[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
+30
View File
@@ -0,0 +1,30 @@
import { renderToString, snapshotTemplateCode } from "../helpers";
// -----------------------------------------------------------------------------
// debugging
// -----------------------------------------------------------------------------
describe("debugging", () => {
test("t-debug", () => {
const consoleLog = console.log;
console.log = jest.fn();
const template = `<div t-debug=""><t t-if="true"><span t-debug="">hey</span></t></div>`;
snapshotTemplateCode(template);
expect(console.log).toHaveBeenCalledTimes(1);
console.log = consoleLog;
});
test("t-log", () => {
const consoleLog = console.log;
console.log = jest.fn();
const template = `<div>
<t t-set="foo" t-value="42"/>
<t t-log="foo + 3"/>
</div>`;
snapshotTemplateCode(template);
renderToString(template);
expect(console.log).toHaveBeenCalledWith(45);
console.log = consoleLog;
});
});