1
0
Fork 0
mirror of synced 2024-07-05 06:20:55 +12:00

few mores tests for control flow

This commit is contained in:
Michael Shanks 2020-01-27 09:01:32 +00:00
parent fdc8867e66
commit 7f58036659

View file

@ -49,4 +49,26 @@ describe("controlFlow", () => {
})
it("should display 3 div, in a looped render, as children", async () => {
const {dom} = await load({
_component: "testlib/div",
_children: [
{
_component: "testlib/div",
className: "my-test-class",
_id: "three_clones"
}
]
});
expect(dom.window.document.body.children.length).toBe(1);
const rootDiv = dom.window.document.body.children[0];
expect(rootDiv.children.length).toBe(3);
expect(rootDiv.children[0].className).toBe("my-test-class");
expect(rootDiv.children[1].className).toBe("my-test-class");
expect(rootDiv.children[2].className).toBe("my-test-class");
})
});