New 🌊 wave for @helm

Commit 970d05af

970d05af8885Merged

Sviatoslav Dumchenko <[email protected]> · 3 years ago · 8 files · +6 added · ~2 modified

Description

chore(tests): add some tests for plan and jsonschema

Details

Commit
970d05af8885
Parent
69ae7ad8e90e

pkg/hooks/config_test.goaddedView file

1+package hooks_test
2+
3+import (
4+ "testing"
5+
6+ "github.com/helmwave/helmwave/pkg/hooks"
7+ "github.com/stretchr/testify/suite"
8+)
9+
10+type ConfigTestSuite struct {
11+ suite.Suite
12+}
13+
14+func TestConfigTestSuite(t *testing.T) {
15+ t.Parallel()
16+ suite.Run(t, new(ConfigTestSuite))
17+}
18+
19+func (s *ConfigTestSuite) TestHooksJSONSchema() {
20+ schema := hooks.Hooks{}.JSONSchema()
21+
22+ s.Require().NotNil(schema)
23+ s.Require().Equal("array", schema.Type)
24+}
25+
26+func (s *ConfigTestSuite) TestHookJSONSchema() {
27+ schema := hooks.NewHook().JSONSchema()
28+
29+ s.Require().NotNil(schema)
30+
31+ keys := schema.Properties.Keys()
32+ s.Require().Contains(keys, "cmd")
33+ s.Require().Contains(keys, "args")
34+ s.Require().Contains(keys, "show")
35+ s.Require().Contains(keys, "allow_failure")
36+}