/** @odoo-module **/ import { registry } from "@web/core/registry"; import { publicComponentService } from "@web/public/public_component_service"; import { getFixture, mount, nextTick } from "../helpers/utils"; import { makeTestEnv } from "../helpers/mock_env"; import { Component, xml } from "@odoo/owl"; let target; const serviceRegistry = registry.category("services"); const publicComponentRegistry = registry.category("public_components"); QUnit.module("Public Component Service", (hooks) => { hooks.beforeEach(() => { target = getFixture(); serviceRegistry.add("public_components", publicComponentService); }); QUnit.test("render Public Component", async (assert) => { class MyPublicComp extends Component { static template = xml`
`; setup() { const type = typeof this.props.info; this.value = type === "object" ? JSON.stringify(this.props.info) : this.props.info; assert.step(`MyPublicComp: ${this.value} - ${type}`); } } publicComponentRegistry.add("my_public_comp", MyPublicComp); class MyComponent extends Component { static template = xml`