Enable the tests for #1804

This commit is contained in:
Pierre-Yves Gerardy 2017-05-29 23:17:04 +02:00 committed by Pierre-Yves Gérardy
parent 9016091adf
commit 4197cf0ae1
2 changed files with 11 additions and 11 deletions

View file

@ -725,6 +725,9 @@ module.exports = function($window) {
} }
else element.setAttribute(key === "className" ? "class" : key, value) else element.setAttribute(key === "className" ? "class" : key, value)
} }
}
function removeAttr(vnode, key, old, ns) {
} }
function setLateAttrs(vnode) { function setLateAttrs(vnode) {
var attrs = vnode.attrs var attrs = vnode.attrs

View file

@ -44,11 +44,10 @@ o.spec("attributes", function() {
o(b.dom.hasAttribute("id")).equals(true) o(b.dom.hasAttribute("id")).equals(true)
o(b.dom.getAttribute("id")).equals("test") o(b.dom.getAttribute("id")).equals("test")
// #1804
render(root, [c]); render(root, [c]);
// #1804 o(c.dom.hasAttribute("id")).equals(false)
// TODO: uncomment
// o(c.dom.hasAttribute("id")).equals(false)
}) })
}) })
o.spec("customElements", function(){ o.spec("customElements", function(){
@ -147,7 +146,7 @@ o.spec("attributes", function() {
o("a lack of attribute removes `value`", function() { o("a lack of attribute removes `value`", function() {
var a = {tag: "input", attrs: {}} var a = {tag: "input", attrs: {}}
var b = {tag: "input", attrs: {value: "test"}} var b = {tag: "input", attrs: {value: "test"}}
// var c = {tag: "input", attrs: {}} var c = {tag: "input", attrs: {}}
render(root, [a]) render(root, [a])
@ -158,10 +157,9 @@ o.spec("attributes", function() {
o(a.dom.value).equals("test") o(a.dom.value).equals("test")
// https://github.com/MithrilJS/mithril.js/issues/1804#issuecomment-304521235 // https://github.com/MithrilJS/mithril.js/issues/1804#issuecomment-304521235
// TODO: Uncomment render(root, [c])
// render(root, [c])
// o(a.dom.value).equals("") o(a.dom.value).equals("")
}) })
o("can be set as number", function() { o("can be set as number", function() {
var a = {tag: "input", attrs: {value: 1}} var a = {tag: "input", attrs: {value: 1}}
@ -276,17 +274,16 @@ o.spec("attributes", function() {
o.spec("textarea.value", function() { o.spec("textarea.value", function() {
o("can be removed by not passing a value", function() { o("can be removed by not passing a value", function() {
var a = {tag: "textarea", attrs: {value:"x"}} var a = {tag: "textarea", attrs: {value:"x"}}
// var b = {tag: "textarea", attrs: {}} var b = {tag: "textarea", attrs: {}}
render(root, [a]) render(root, [a])
o(a.dom.value).equals("x") o(a.dom.value).equals("x")
// https://github.com/MithrilJS/mithril.js/issues/1804#issuecomment-304521235 // https://github.com/MithrilJS/mithril.js/issues/1804#issuecomment-304521235
// TODO: Uncomment render(root, [b])
// render(root, [b])
// o(b.dom.value).equals("") o(b.dom.value).equals("")
}) })
o("isn't set when equivalent to the previous value and focused", function() { o("isn't set when equivalent to the previous value and focused", function() {
var $window = domMock({spy: o.spy}) var $window = domMock({spy: o.spy})