From b4c9cb51422c160fff23608d5081ba997b587aaf Mon Sep 17 00:00:00 2001 From: "Hugo P.Brito" Date: Wed, 1 Jul 2026 12:14:17 +0100 Subject: [PATCH] test(ui): cover kubeconfig backend-deferred validation --- ui/types/formSchemas.test.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ui/types/formSchemas.test.ts b/ui/types/formSchemas.test.ts index c2e5be53bb..58eb33128f 100644 --- a/ui/types/formSchemas.test.ts +++ b/ui/types/formSchemas.test.ts @@ -197,4 +197,26 @@ users: }), ); }); + + it("accepts malformed kubeconfig content for backend validation", () => { + const schema = addCredentialsFormSchema("kubernetes"); + + const result = schema.safeParse({ + ...BASE_KUBERNETES_VALUES, + [ProviderCredentialFields.KUBECONFIG_CONTENT]: "apiVersion: [", + }); + + expect(result.success).toBe(true); + }); + + it("accepts non-mapping kubeconfig content for backend validation", () => { + const schema = addCredentialsFormSchema("kubernetes"); + + const result = schema.safeParse({ + ...BASE_KUBERNETES_VALUES, + [ProviderCredentialFields.KUBECONFIG_CONTENT]: "[]", + }); + + expect(result.success).toBe(true); + }); });