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); + }); });