Tests: Wrap some component definitions in createComponent() calls

These are the ones that would have been tedious to automate.
jscodeshift will handle the remaining ones
This commit is contained in:
Pierre-Yves Gerardy 2017-02-19 01:18:02 +01:00
parent 90b67b42f0
commit ac38335453
5 changed files with 43 additions and 43 deletions

View file

@ -910,7 +910,7 @@ o.spec("updateNodes", function() {
var createComponent = cmp.create
o("fragment child toggles from null when followed by null component then tag", function() {
var component = {view: function() {return null}}
var component = createComponent({view: function() {return null}})
var vnodes = [{tag: "[", children: [{tag: "a"}, {tag: component}, {tag: "b"}]}]
var temp = [{tag: "[", children: [null, {tag: component}, {tag: "b"}]}]
var updated = [{tag: "[", children: [{tag: "a"}, {tag: component}, {tag: "b"}]}]
@ -925,8 +925,8 @@ o.spec("updateNodes", function() {
})
o("fragment child toggles from null in component when followed by null component then tag", function() {
var flag = true
var a = {view: function() {return flag ? {tag: "a"} : null}}
var b = {view: function() {return null}}
var a = createComponent({view: function() {return flag ? {tag: "a"} : null}})
var b = createComponent({view: function() {return null}})
var vnodes = [{tag: "[", children: [{tag: a}, {tag: b}, {tag: "s"}]}]
var temp = [{tag: "[", children: [{tag: a}, {tag: b}, {tag: "s"}]}]
var updated = [{tag: "[", children: [{tag: a}, {tag: b}, {tag: "s"}]}]