Skip to content

Commit 1e3c7b4

Browse files
committed
test(NotificationTemplate): ApplySuccesful
1 parent b3a8677 commit 1e3c7b4

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

controllers/notificationtemplate_controller_test.go

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,26 @@ var _ = Describe("NotificationTemplate Reconciler: Provoke Conditions", func() {
4545
ObjectMeta: objectMetaApplyFailed,
4646
Spec: v1beta1.GrafanaNotificationTemplateSpec{
4747
GrafanaCommonSpec: commonSpecApplyFailed,
48-
Name: "NoMatch",
48+
Name: "ApplyFailed",
4949
},
5050
},
5151
wantCondition: conditionNotificationTemplateSynchronized,
5252
wantReason: conditionReasonApplyFailed,
5353
wantErr: "failed to apply to all instances",
5454
},
55+
{
56+
name: "Successfully applied resource to instance",
57+
cr: &v1beta1.GrafanaNotificationTemplate{
58+
ObjectMeta: objectMetaSynchronized,
59+
Spec: v1beta1.GrafanaNotificationTemplateSpec{
60+
GrafanaCommonSpec: commonSpecSynchronized,
61+
Name: "Synchronized",
62+
Template: `{{ define "StatusAlert" }}{{.Status}}{{ end }}`,
63+
},
64+
},
65+
wantCondition: conditionNotificationTemplateSynchronized,
66+
wantReason: conditionReasonApplySuccessful,
67+
},
5568
}
5669

5770
for _, test := range tests {

0 commit comments

Comments
 (0)