Add more unit tests

This commit is contained in:
Jamie Curnow committed 2023-08-01 08:19:58 +10:00
1 parent db95a465c8
commit 155e09407f
5 files changed
+152 -5

No files matched your search

@@ -0,0 +1,29 @@
package dnsproviders
import (
"npm/internal/util"
"testing"
"github.com/stretchr/testify/assert"
)
func TestAdProvider(t *testing.T) {
provider := getDNSAd()
provider.ConvertToUpdatable()
json, err := provider.GetJsonSchema()
assert.Nil(t, err)
assert.Equal(t, `{
"title": "dns_ad",
"type": "object",
"additionalProperties": false,
"minProperties": 1,
"properties": {
"AD_API_KEY": {
"title": "api-key",
"type": "string",
"additionalProperties": false,
"minLength": 1
}
}
}`, util.PrettyPrintJSON(json))
}