mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[IMP] component: display better error message if render is empty
closes #446
This commit is contained in:
@@ -108,6 +108,21 @@ describe("basic widget properties", () => {
|
||||
);
|
||||
});
|
||||
|
||||
test("display an error message if result of rendering is empty", async () => {
|
||||
class SomeWidget extends Component<any, any> {
|
||||
static template = xml`<t/>`;
|
||||
}
|
||||
const widget = new SomeWidget();
|
||||
let error;
|
||||
try {
|
||||
await widget.mount(fixture);
|
||||
} catch (e) {
|
||||
error = e;
|
||||
}
|
||||
expect(error).toBeDefined();
|
||||
expect(error.message).toBe("Rendering 'SomeWidget' did not return anything");
|
||||
});
|
||||
|
||||
test("crashes if it cannot find a template", async () => {
|
||||
expect.assertions(1);
|
||||
class SomeWidget extends Component<any, any> {}
|
||||
|
||||
Reference in New Issue
Block a user