Skip to content

Commit 7b4d6f5

Browse files
committed
fix: unit test
1 parent fb87401 commit 7b4d6f5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

client/executors/v1/webhooks.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ func (s WebhooksClient) Get(name string) (*executorsv1.Webhook, error) {
5050
}
5151

5252
// GetByEvent gets all webhooks with given event
53-
func (s WebhooksClient) GetByEvent(event string) (*executorsv1.WebhookList, error) {
53+
func (s WebhooksClient) GetByEvent(event executorsv1.EventType) (*executorsv1.WebhookList, error) {
5454
list := &executorsv1.WebhookList{}
5555
err := s.Client.List(context.Background(), list, &client.ListOptions{Namespace: s.Namespace})
5656
if err != nil {

client/executors/v1/webhooks_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func TestWebhooks(t *testing.T) {
2020
Namespace: "test-ns",
2121
},
2222
Spec: executorsv1.WebhookSpec{
23-
Events: []string{"test-event1"},
23+
Events: []executorsv1.EventType{"test-event1"},
2424
},
2525
Status: executorsv1.WebhookStatus{},
2626
},
@@ -30,7 +30,7 @@ func TestWebhooks(t *testing.T) {
3030
Namespace: "test-ns",
3131
},
3232
Spec: executorsv1.WebhookSpec{
33-
Events: []string{"test-event2"},
33+
Events: []executorsv1.EventType{"test-event2"},
3434
},
3535
Status: executorsv1.WebhookStatus{},
3636
},
@@ -40,7 +40,7 @@ func TestWebhooks(t *testing.T) {
4040
Namespace: "test-ns",
4141
},
4242
Spec: executorsv1.WebhookSpec{
43-
Events: []string{"test-event1"},
43+
Events: []executorsv1.EventType{"test-event1"},
4444
},
4545
Status: executorsv1.WebhookStatus{},
4646
},
@@ -84,7 +84,7 @@ func TestWebhooks(t *testing.T) {
8484
Namespace: "wrong-ns",
8585
},
8686
Spec: executorsv1.WebhookSpec{
87-
Events: []string{"test-event"},
87+
Events: []executorsv1.EventType{"test-event"},
8888
},
8989
Status: executorsv1.WebhookStatus{},
9090
}

0 commit comments

Comments
 (0)