diff --git a/kapacitor/alerts_test.go b/kapacitor/alerts_test.go index d1c694bb2..206350e45 100644 --- a/kapacitor/alerts_test.go +++ b/kapacitor/alerts_test.go @@ -9,6 +9,7 @@ import ( func TestAlertServices(t *testing.T) { tests := []struct { name string + skip string rule chronograf.AlertRule want chronograf.TICKScript wantErr bool @@ -181,11 +182,33 @@ func TestAlertServices(t *testing.T) { .appKey('a') .primaryProperty('b') .secondaryProperty('c') +`, + }, + { + name: "Test Teams", + skip: "Parsing is not implemented yet in the kapactior pipeline!", + rule: chronograf.AlertRule{ + AlertNodes: chronograf.AlertNodes{ + Teams: []*chronograf.Teams{{ + Team: "teams.microsoft.com/team/", + Channel: "#channel", + ChannelURL: "https://outlook.office.com/webhook/...", + }}, + }, + }, + want: `alert() + .teams() + .channelURL('https://outlook.office.com/webhook/...') + .team('teams.microsoft.com/team/') + .channel('#channel') `, }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { + if tt.skip != "" { + t.Skip(tt.skip) + } got, err := AlertServices(tt.rule) if (err != nil) != tt.wantErr { t.Errorf("%q. AlertServices() error = %v, wantErr %v", tt.name, err, tt.wantErr)