Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions addons/website/static/src/core/website_core.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ class WebsiteCore {
};
this.owlApp = new App(null, appConfig);
}
if (!this.active) {
return;
}
const root = this.owlApp.createRoot(C, { props: null, env: this.env });
this.roots.push(root);
const compElem = document.createElement("owl-component");
Expand Down
11 changes: 11 additions & 0 deletions addons/website/static/tests/core/website_core.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { animationFrame } from "@odoo/hoot-mock";

import { Interaction } from "@website/core/interaction";
import { startInteraction } from "./helpers";
import { Component, xml } from "@odoo/owl";

test("wait for translation before starting interactions", async () => {
let flag = false;
Expand Down Expand Up @@ -35,3 +36,13 @@ test("starting interactions twice should only actually do it once", async () =>
await animationFrame();
expect(n).toBe(1);
});


test("can mount a component", async () => {
class Test extends Component {
static selector = ".test";
static template = xml`owl component`;
}
const {el} = await startInteraction(Test, `<div class="test"></div>`);
expect(el.querySelector(".test").innerHTML).toBe(`<owl-component contenteditable="false" data-oe-protected="true">owl component</owl-component>`);
});