[FIX] re-introduce tests

This commit is contained in:
Lucas Perais (lpe)
2021-10-18 17:52:25 +02:00
committed by Aaron Bohy
parent d569ea1c28
commit 10df0b5f4a
17 changed files with 616 additions and 79 deletions
+31
View File
@@ -938,4 +938,35 @@ describe("lifecycle hooks", () => {
expect(mounted).toBe(true);
expect(created).toBe(true);
});
test.skip("two different call to mounted/willunmount should work", async () => {
/*const steps: string[] = [];
function useMyHook(i) {
onMounted(() => {
steps.push("hook:mounted" + i);
});
onWillUnmount(() => {
steps.push("hook:willunmount" + i);
});
}
class MyComponent extends Component {
static template = xml`<div>hey</div>`;
constructor() {
super();
useMyHook(1);
useMyHook(2);
}
}
const component = new MyComponent();
await component.mount(fixture);
expect(fixture.innerHTML).toBe("<div>hey</div>");
component.unmount();
expect(fixture.innerHTML).toBe("");
expect(steps).toEqual([
"hook:mounted1",
"hook:mounted2",
"hook:willunmount2",
"hook:willunmount1",
]);*/
});
});