MCPcopy Create free account
hub / github.com/authorizerdev/authorizer / TestWebhookLogs

Function TestWebhookLogs

internal/integration_tests/webhook_logs_test.go:15–37  ·  view source on GitHub ↗

TestWebhookLogs tests the _webhook_logs query

(t *testing.T)

Source from the content-addressed store, hash-verified

13
14// TestWebhookLogs tests the _webhook_logs query
15func TestWebhookLogs(t *testing.T) {
16 cfg := getTestConfig()
17 ts := initTestSetup(t, cfg)
18 req, ctx := createContext(ts)
19
20 t.Run("should fail without admin auth", func(t *testing.T) {
21 req.Header.Set("Cookie", "")
22 res, err := ts.GraphQLProvider.WebhookLogs(ctx, &model.ListWebhookLogRequest{})
23 assert.Error(t, err)
24 assert.Nil(t, res)
25 })
26
27 t.Run("should list webhook logs with admin auth", func(t *testing.T) {
28 h, err := crypto.EncryptPassword(cfg.AdminSecret)
29 require.NoError(t, err)
30 req.Header.Set("Cookie", fmt.Sprintf("%s=%s", constants.AdminCookieName, h))
31
32 res, err := ts.GraphQLProvider.WebhookLogs(ctx, &model.ListWebhookLogRequest{})
33 require.NoError(t, err)
34 assert.NotNil(t, res)
35 assert.NotNil(t, res.Pagination)
36 })
37}

Callers

nothing calls this directly

Calls 8

EncryptPasswordFunction · 0.92
getTestConfigFunction · 0.85
initTestSetupFunction · 0.85
createContextFunction · 0.85
ErrorMethod · 0.80
SetMethod · 0.65
WebhookLogsMethod · 0.65
RunMethod · 0.45

Tested by

no test coverage detected