Do not normalise component children on ingestion (#2155)
* Do not normalise component children on ingestion * Don't normalise vnode children * Component hyperscript tests: children aren't normalised * test, not text * Update change log: #2155 & #2064
This commit is contained in:
parent
0f498e0aec
commit
1579fe8430
6 changed files with 59 additions and 15 deletions
|
|
@ -551,19 +551,29 @@ o.spec("hyperscript", function() {
|
|||
o.spec("components", function() {
|
||||
o("works with POJOs", function() {
|
||||
var component = {
|
||||
view: function() {
|
||||
return m("div")
|
||||
}
|
||||
view: function() {}
|
||||
}
|
||||
var vnode = m(component, {id: "a"}, "b")
|
||||
|
||||
o(vnode.tag).equals(component)
|
||||
o(vnode.attrs.id).equals("a")
|
||||
o(vnode.children.length).equals(1)
|
||||
o(vnode.children[0].tag).equals("#")
|
||||
o(vnode.children[0].children).equals("b")
|
||||
o(vnode.children[0]).equals("b")
|
||||
})
|
||||
o("works with functions", function() {
|
||||
o("works with constructibles", function() {
|
||||
var component = o.spy()
|
||||
component.prototype.view = function() {}
|
||||
|
||||
var vnode = m(component, {id: "a"}, "b")
|
||||
|
||||
o(component.callCount).equals(0)
|
||||
|
||||
o(vnode.tag).equals(component)
|
||||
o(vnode.attrs.id).equals("a")
|
||||
o(vnode.children.length).equals(1)
|
||||
o(vnode.children[0]).equals("b")
|
||||
})
|
||||
o("works with closures", function () {
|
||||
var component = o.spy()
|
||||
|
||||
var vnode = m(component, {id: "a"}, "b")
|
||||
|
|
@ -573,8 +583,7 @@ o.spec("hyperscript", function() {
|
|||
o(vnode.tag).equals(component)
|
||||
o(vnode.attrs.id).equals("a")
|
||||
o(vnode.children.length).equals(1)
|
||||
o(vnode.children[0].tag).equals("#")
|
||||
o(vnode.children[0].children).equals("b")
|
||||
o(vnode.children[0]).equals("b")
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue