add more tests

Signed-off-by: 楚岳 <wangyike.wyk@alibaba-inc.com>
This commit is contained in:
楚岳
2022-01-24 17:06:27 +08:00
parent 8e2bf9c68d
commit 661d9f7a47
+25
View File
@@ -78,4 +78,29 @@ var _ = Describe("addon usecase test", func() {
}
}
})
It("Test render without ui-schema", func() {
addonName := "test-without-schema"
defaultSchema := []*utils.UIParameter{
{
JSONKey: "version",
Sort: 3,
},
{
JSONKey: "domain",
Sort: 8,
},
}
res := renderAddonCustomUISchema(ctx, k8sClient, addonName, defaultSchema)
Expect(len(res)).Should(BeEquivalentTo(2))
for _, re := range res {
if re.JSONKey == "version" {
Expect(re.Validate).Should(BeNil())
Expect(re.Sort).Should(BeEquivalentTo(3))
}
if re.JSONKey == "domain" {
Expect(re.Sort).Should(BeEquivalentTo(8))
}
}
})
})