Skip to content

Commit e6266d4

Browse files
committed
refactor: fix test with not 'items:'
1 parent bbb0b08 commit e6266d4

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

api/resource/factory_test.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,17 @@ kind: List
301301
t.Fatalf("failed to create new instance with %v: %v", deploymentB, errB)
302302
}
303303

304+
deploymentNoItems := "deployment-no-items"
305+
testDeploymentNoItems, errNoItems := factory.FromMap(
306+
map[string]interface{}{
307+
"apiVersion": "v1",
308+
"kind": "List",
309+
},
310+
)
311+
if errNoItems != nil {
312+
t.Fatalf("failed to create new instance with %v: %v", deploymentNoItems, testDeploymentNoItems)
313+
}
314+
304315
fSys := filesys.MakeFsInMemory()
305316
fSys.WriteFile(string(patchGood1), []byte(patch1))
306317
fSys.WriteFile(string(patchGood2), []byte(patch2))
@@ -363,7 +374,7 @@ kind: List
363374
},
364375
"listWithNoItems": {
365376
input: []types.PatchStrategicMerge{patchList4},
366-
expectedOut: []*Resource{},
377+
expectedOut: []*Resource{testDeploymentNoItems},
367378
expectedErr: false,
368379
},
369380
}

0 commit comments

Comments
 (0)