mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
t-widget directive
This commit is contained in:
@@ -311,7 +311,7 @@ describe("attributes", () => {
|
||||
);
|
||||
});
|
||||
|
||||
xit("various escapes", () => {
|
||||
test.skip("various escapes", () => {
|
||||
// need to think about this... This one does not pass, but I am not sure it is
|
||||
// a correct test
|
||||
const template = `
|
||||
|
||||
@@ -93,3 +93,23 @@ describe("destroy method", () => {
|
||||
expect(document.contains(widget.el)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
describe("composition", () => {
|
||||
test("a widget with a sub widget", async () => {
|
||||
|
||||
class WidgetB extends Widget {
|
||||
template= `<div>world</div>`;
|
||||
}
|
||||
|
||||
class WidgetA extends Widget {
|
||||
name="a";
|
||||
template= `<div>Hello<t t-widget="b"/></div>`;
|
||||
widgets = {b: WidgetB}
|
||||
}
|
||||
|
||||
const widget = makeWidget(WidgetA);
|
||||
const target = document.createElement("div");
|
||||
await widget.mount(target);
|
||||
expect(target.innerHTML).toBe("<div>Hello<div>world</div></div>");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user