[IMP] component,qweb: props validation

We re-add the possibility to validate props when dev mode is active.
No change in the API right Now. The dev mode is activated via the
configure method of App class.
This commit is contained in:
Mathieu Duckerts-Antoine
2021-10-20 16:08:31 +02:00
committed by Géry Debongnie
parent d1425c7100
commit 6e0834ce5e
15 changed files with 1308 additions and 714 deletions
+4 -2
View File
@@ -15,7 +15,9 @@ describe("error handling", () => {
test("cannot add twice the same template", () => {
const context = new TestContext();
context.addTemplate("test", `<t></t>`);
expect(() => context.addTemplate("test", "<div/>", { allowDuplicate: true })).not.toThrow("already defined");
expect(() => context.addTemplate("test", "<div/>", { allowDuplicate: true })).not.toThrow(
"already defined"
);
expect(() => context.addTemplate("test", "<div/>")).toThrow("already defined");
});
@@ -37,4 +39,4 @@ describe("error handling", () => {
"Unknown QWeb directive: 't-best-beer'"
);
});
});
});
+2 -5
View File
@@ -1,7 +1,4 @@
import {
renderToString,
snapshotEverything,
} from "../helpers";
import { renderToString, snapshotEverything } from "../helpers";
snapshotEverything();
@@ -28,4 +25,4 @@ describe("qweb t-tag", () => {
const expected = `<div taste=\"raspberry\" class=\"blueberry\">gooseberry</div>`;
expect(renderToString(template, { tag: "div" })).toBe(expected);
});
});
});