fix diff of css rule removal

This commit is contained in:
Leo Horie 2014-05-09 22:21:43 -04:00
parent dc9cae09fc
commit 63a7461657
6 changed files with 41 additions and 6 deletions

View file

@ -344,6 +344,19 @@ function testMithril(mock) {
var valueAfter2 = root.childNodes[0].childNodes[1].nodeName
return valueBefore1 === "UL" && valueAfter1 === "" && valueBefore2 === "" && valueAfter2 === "UL"
})
test(function() {
var root = mock.document.createElement("div")
m.render(root, m("div", {style: {background: "red"}}))
var valueBefore = root.childNodes[0].style.background
m.render(root, m("div", {style: {}}))
var valueAfter = root.childNodes[0].style.background
return valueBefore === "red" && valueAfter === ""
})
test(function() {
var root = mock.document.createElement("div")
m.render(root, m("div[style='background:red']"))
return root.childNodes[0].style === "background:red"
})
//end m.render
//m.redraw

View file

@ -5,6 +5,7 @@ mock.window = new function() {
window.document.childNodes = []
window.document.createElement = function(tag) {
return {
style: {},
childNodes: [],
nodeName: tag.toUpperCase(),
appendChild: window.document.appendChild,