mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
add widget test
This commit is contained in:
@@ -113,10 +113,20 @@ describe("basic widget properties", () => {
|
||||
expect(renderCalls).toBe(1);
|
||||
});
|
||||
|
||||
test("keep a reference to env", async () => {
|
||||
test("keeps a reference to env", async () => {
|
||||
const widget = new Widget(env);
|
||||
expect(widget.env).toBe(env);
|
||||
});
|
||||
|
||||
test("do not remove previously rendered dom if not necessary", async () => {
|
||||
const widget = new Widget(env);
|
||||
await widget.mount(fixture);
|
||||
expect(fixture.innerHTML).toBe(`<div></div>`);
|
||||
widget.el!.appendChild(document.createElement("span"));
|
||||
expect(fixture.innerHTML).toBe(`<div><span></span></div>`);
|
||||
widget.render();
|
||||
expect(fixture.innerHTML).toBe(`<div><span></span></div>`);
|
||||
});
|
||||
});
|
||||
|
||||
describe("lifecycle hooks", () => {
|
||||
|
||||
Reference in New Issue
Block a user