mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[IMP] component: add props on root components
This is a partial revert of commit 7d249d6f09.
The reason is that this changes made it much harder to unit test
components. Before, we could simply instantiate a component
like this:
const my|Comp = new MyComponent(null, props);
and then simply test it. This commit reestablish that possibility.
This commit is contained in:
@@ -71,9 +71,9 @@ class WidgetA extends Widget {
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
describe("basic widget properties", () => {
|
||||
test("props is not defined on root components", async () => {
|
||||
const widget = new Widget();
|
||||
expect(widget.props).toBe(undefined);
|
||||
test("props is set on root components", async () => {
|
||||
const widget = new Widget(null, {});
|
||||
expect(widget.props).toEqual({});
|
||||
});
|
||||
|
||||
test("has no el after creation", async () => {
|
||||
|
||||
Reference in New Issue
Block a user