mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
lint
This commit is contained in:
+16
-16
@@ -56,12 +56,14 @@ describe("basic widget properties", () => {
|
|||||||
|
|
||||||
test("widget style and classname", async () => {
|
test("widget style and classname", async () => {
|
||||||
class StyledWidget extends Widget {
|
class StyledWidget extends Widget {
|
||||||
template= `<div style="font-weight:bold;" class="some-class">world</div>`;
|
template = `<div style="font-weight:bold;" class="some-class">world</div>`;
|
||||||
}
|
}
|
||||||
const widget = makeWidget(StyledWidget);
|
const widget = makeWidget(StyledWidget);
|
||||||
const target = document.createElement("div");
|
const target = document.createElement("div");
|
||||||
await widget.mount(target);
|
await widget.mount(target);
|
||||||
expect(target.innerHTML).toBe(`<div style="font-weight:bold;" class="some-class">world</div>`);
|
expect(target.innerHTML).toBe(
|
||||||
|
`<div style="font-weight:bold;" class="some-class">world</div>`
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -104,7 +106,7 @@ describe("lifecycle hooks", () => {
|
|||||||
document.body.appendChild(target);
|
document.body.appendChild(target);
|
||||||
await widget.mount(target);
|
await widget.mount(target);
|
||||||
expect(mounted).toBe(true);
|
expect(mounted).toBe(true);
|
||||||
target.remove()
|
target.remove();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -120,19 +122,17 @@ describe("destroy method", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("composition", () => {
|
describe("composition", () => {
|
||||||
|
class WidgetA extends Widget {
|
||||||
class WidgetB extends Widget {
|
name = "a";
|
||||||
template= `<div>world</div>`;
|
template = `<div>Hello<t t-widget="b"/></div>`;
|
||||||
|
widgets = { b: WidgetB };
|
||||||
}
|
}
|
||||||
|
|
||||||
class WidgetA extends Widget {
|
class WidgetB extends Widget {
|
||||||
name="a";
|
template = `<div>world</div>`;
|
||||||
template= `<div>Hello<t t-widget="b"/></div>`;
|
|
||||||
widgets = {b: WidgetB}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
test("a widget with a sub widget", async () => {
|
test("a widget with a sub widget", async () => {
|
||||||
|
|
||||||
const widget = makeWidget(WidgetA);
|
const widget = makeWidget(WidgetA);
|
||||||
const target = document.createElement("div");
|
const target = document.createElement("div");
|
||||||
await widget.mount(target);
|
await widget.mount(target);
|
||||||
@@ -140,11 +140,11 @@ describe("composition", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("t-refs on widget are widgets", async () => {
|
test("t-refs on widget are widgets", async () => {
|
||||||
class WidgetC extends Widget {
|
class WidgetC extends Widget {
|
||||||
name="a";
|
name = "a";
|
||||||
template= `<div t-debug="1">Hello<t t-ref="mywidgetb" t-widget="b"/></div>`;
|
template = `<div t-debug="1">Hello<t t-ref="mywidgetb" t-widget="b"/></div>`;
|
||||||
widgets = {b: WidgetB}
|
widgets = { b: WidgetB };
|
||||||
}
|
}
|
||||||
const widget = makeWidget(WidgetC);
|
const widget = makeWidget(WidgetC);
|
||||||
const target = document.createElement("div");
|
const target = document.createElement("div");
|
||||||
await widget.mount(target);
|
await widget.mount(target);
|
||||||
|
|||||||
Reference in New Issue
Block a user