MCPcopy Create free account
hub / github.com/daodst/chat / TestValidateActionPositives

Function TestValidateActionPositives

internal/pushrules/validate_test.go:97–116  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

95}
96
97func TestValidateActionPositives(t *testing.T) {
98 tsts := []struct {
99 Name string
100 Action Action
101 WantNoErrString string
102 }{
103 {"invalidKind", Action{Kind: NotifyAction}, "invalid rule action kind"},
104 }
105 for _, tst := range tsts {
106 t.Run(tst.Name, func(t *testing.T) {
107 errs := validateAction(&tst.Action)
108 for _, err := range errs {
109 t.Logf("Got error %#v", err)
110 if strings.Contains(err.Error(), tst.WantNoErrString) {
111 t.Errorf("errs: got %#v, want none containing %q", errs, tst.WantNoErrString)
112 }
113 }
114 })
115 }
116}
117
118func TestValidateConditionNegatives(t *testing.T) {
119 tsts := []struct {

Callers

nothing calls this directly

Calls 3

validateActionFunction · 0.85
RunMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected