mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[FIX] component: allow fragments in method mount
It is now possible to mount components in fragments closes #494
This commit is contained in:
@@ -91,6 +91,17 @@ describe("basic widget properties", () => {
|
||||
expect(fixture.innerHTML).toBe("<div>content</div>");
|
||||
});
|
||||
|
||||
test("can be mounted on a documentFragment", async () => {
|
||||
class SomeWidget extends Component<any, any> {
|
||||
static template = xml`<div>content</div>`;
|
||||
}
|
||||
const widget = new SomeWidget();
|
||||
await widget.mount(document.createDocumentFragment());
|
||||
expect(fixture.innerHTML).toBe("");
|
||||
await widget.mount(fixture);
|
||||
expect(fixture.innerHTML).toBe("<div>content</div>");
|
||||
});
|
||||
|
||||
test("display a nice message if mounted on a non existing node", async () => {
|
||||
class SomeWidget extends Component<any, any> {
|
||||
static template = xml`<div>content</div>`;
|
||||
|
||||
Reference in New Issue
Block a user