#380 empty value attr in option should show up

This commit is contained in:
Leo Horie 2014-12-08 11:47:27 -05:00
parent d05b903024
commit e453ec7ce3
2 changed files with 7 additions and 2 deletions

View file

@ -409,8 +409,13 @@ test("mixing trusted content w/ td", function() {
equal(dummyEl.childNodes[1].nodeName, "I")
})
test("", function() {
test("0 should not be treated as empty string", function() {
m.render(dummyEl, m("input", {value: ""}))
m.render(dummyEl, m("input", {value: 0}))
equal(dummyEl.childNodes[0].value, "0")
})
test("empty value in <option> should show as attribute", function() {
m.render(dummyEl, m("select", m("option", {value: ""}, "aaa")))
equal(dummyEl.childNodes[0].innerHTML, '<option value="">aaa</option>')
})