MCPcopy Create free account
hub / github.com/devaccuracy/ledgerforge / TestListHooks

Function TestListHooks

api/hooks_test.go:90–109  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

88}
89
90func TestListHooks(t *testing.T) {
91 router, _, err := setupRouter(t)
92 if err != nil {
93 t.Fatalf("Failed to setup router: %v", err)
94 }
95
96 t.Run("List all hooks", func(t *testing.T) {
97 req := httptest.NewRequest("GET", "/hooks", nil)
98 resp := httptest.NewRecorder()
99 router.ServeHTTP(resp, req)
100 assert.Equal(t, http.StatusOK, resp.Code)
101 })
102
103 t.Run("List hooks by type", func(t *testing.T) {
104 req := httptest.NewRequest("GET", "/hooks?type=PRE_TRANSACTION", nil)
105 resp := httptest.NewRecorder()
106 router.ServeHTTP(resp, req)
107 assert.Equal(t, http.StatusOK, resp.Code)
108 })
109}
110
111func TestDeleteHook(t *testing.T) {
112 router, _, err := setupRouter(t)

Callers

nothing calls this directly

Calls 1

setupRouterFunction · 0.85

Tested by

no test coverage detected