mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] app: validate props for root component in dev mode
Before this commit, only sub components were validated.
This commit is contained in:
@@ -87,6 +87,22 @@ describe("props validation", () => {
|
||||
expect(error!.message).toBe("Invalid props for component 'SubComp': 'message' is missing");
|
||||
});
|
||||
|
||||
test("validate props for root component", async () => {
|
||||
class Root extends Component {
|
||||
static props = ["message"];
|
||||
static template = xml`<div t-esc="message"/>`;
|
||||
}
|
||||
|
||||
let error: Error;
|
||||
try {
|
||||
await mount(Root, fixture, { dev: true });
|
||||
} catch (e) {
|
||||
error = e as Error;
|
||||
}
|
||||
expect(error!).toBeDefined();
|
||||
expect(error!.message).toBe("Invalid props for component 'Root': 'message' is missing");
|
||||
});
|
||||
|
||||
test("validate simple types", async () => {
|
||||
const Tests = [
|
||||
{ type: Number, ok: 1, ko: "1" },
|
||||
|
||||
Reference in New Issue
Block a user