mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
22a79cdedd
in order to separate compiler/ and runtime/ code
26 lines
641 B
TypeScript
26 lines
641 B
TypeScript
import { text } from "../../src/runtime/blockdom";
|
|
import { Component, mount, xml } from "../../src/index";
|
|
import { makeTestFixture, snapshotEverything } from "../helpers";
|
|
|
|
snapshotEverything();
|
|
|
|
let fixture: HTMLElement;
|
|
|
|
beforeEach(() => {
|
|
fixture = makeTestFixture();
|
|
});
|
|
|
|
describe("t-call-block", () => {
|
|
test("simple t-call-block with static text", async () => {
|
|
class Test extends Component {
|
|
static template = xml`<div><t t-call-block="myBlock()"/></div>`;
|
|
myBlock() {
|
|
return text("hello");
|
|
}
|
|
}
|
|
|
|
await mount(Test, fixture);
|
|
expect(fixture.innerHTML).toBe("<div>hello</div>");
|
|
});
|
|
});
|