You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test("it should complain about no dispatch method",(t)=>{
@@ -34,6 +38,17 @@ test("it should complain about no dispatch method", (t) => {
34
38
snapshot \`{"width":2,"height":2}\` is not assignable to type: \`Box | Square\` (Multiple types are applicable and no dispatch method is defined for the union), expected an instance of \`Box | Square\` or a snapshot like \`({ width: number; height: number } | { width: number })\` instead.`)
35
39
})
36
40
41
+
test("it should have parent whenever creating or applying from a complex data structure to a model which has Union typed children",(t)=>{
42
+
const{Block, Heighed}=createTestFactories()
43
+
constblock=Block.create({
44
+
list: [{width: 2,height: 2}]
45
+
})
46
+
47
+
constchild=tryResolve(block,"./list/0")
48
+
49
+
hasParent(child) ? t.pass() : t.fail()
50
+
})
51
+
37
52
test("it should complain about no dispatch method and multiple applicable types",(t)=>{
38
53
const{Heighed}=createTestFactories()
39
54
@@ -90,4 +105,4 @@ test("it should compute exact union types - 2", (t) => {
0 commit comments