[FIX] blockdom: undefined properties are treated as empty strings

This commit is contained in:
Géry Debongnie
2022-02-15 08:58:07 +01:00
committed by Samuel Degueldre
parent 804ad3c35e
commit 3536f41f00
4 changed files with 41 additions and 1 deletions
+9
View File
@@ -169,6 +169,15 @@ describe("properties", () => {
expect(input.value).toBe("potato");
});
test("input with value attribute, and undefined given", () => {
const block = createBlock(`<input block-attribute-0="value"/>`);
const tree = block([undefined]);
mount(tree, fixture);
const input = fixture.querySelector("input")!;
expect(input.value).toBe("");
});
test("input type=checkbox with checked attribute", () => {
// render input with initial value
const block = createBlock(`<input type="checkbox" block-attribute-0="checked"/>`);