From 14ae35229717882f9ef5ddaeb350c0f00f6a6e7f Mon Sep 17 00:00:00 2001 From: quobix Date: Mon, 5 Aug 2024 08:11:06 -0400 Subject: [PATCH] more coverage bumps --- datamodel/high/base/schema_proxy_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/datamodel/high/base/schema_proxy_test.go b/datamodel/high/base/schema_proxy_test.go index 51ebac1..0c604a3 100644 --- a/datamodel/high/base/schema_proxy_test.go +++ b/datamodel/high/base/schema_proxy_test.go @@ -69,6 +69,20 @@ func TestCreateSchemaProxy(t *testing.T) { sp := CreateSchemaProxy(&Schema{Description: "iAmASchema"}) assert.Equal(t, "iAmASchema", sp.rendered.Description) assert.False(t, sp.IsReference()) + assert.Nil(t, sp.GetValueNode()) +} + +func TestCreateSchemaProxy_NoNilValue(t *testing.T) { + sp := CreateSchemaProxy(&Schema{Description: "iAmASchema"}) + sp.Schema() + + // jerry rig the test. + nodeRef := low.NodeReference[*lowbase.SchemaProxy]{} + nodeRef.ValueNode = &yaml.Node{} + sp.schema = &nodeRef + + assert.Equal(t, "iAmASchema", sp.rendered.Description) + assert.NotNil(t, sp.GetValueNode()) } func TestCreateSchemaProxyRef(t *testing.T) {