[FIX] blockdom: ignore attributes with undefined value

This commit is contained in:
Géry Debongnie
2021-12-13 14:41:07 +01:00
committed by Mathieu Duckerts-Antoine
parent 4cde06d685
commit c37f3445f6
4 changed files with 49 additions and 1 deletions
+8
View File
@@ -65,6 +65,14 @@ test("class attribute", async () => {
expect(fixture.innerHTML).toBe(`<div class="0"></div>`);
});
test("attribute with undefined value", async () => {
const block = createBlock('<div block-attribute-0="abc"></div>');
const tree = block([undefined]);
mount(tree, fixture);
expect(fixture.innerHTML).toBe(`<div></div>`);
});
test("class attribute with undefined value", async () => {
const block = createBlock('<div block-attribute-0="class"></div>');
const tree = block([undefined]);