MCPcopy Create free account
hub / github.com/compozy/agh / TestHookRunsHandlerRejectsInvalidLast

Function TestHookRunsHandlerRejectsInvalidLast

internal/api/httpapi/hooks_test.go:324–345  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

322}
323
324func TestHookRunsHandlerRejectsInvalidLast(t *testing.T) {
325 t.Parallel()
326
327 homePaths := newTestHomePaths(t)
328 manager := stubSessionManager{
329 StatusFn: func(_ context.Context, id string) (*session.Info, error) {
330 return newSessionInfo(id), nil
331 },
332 }
333
334 engine := newTestRouter(t, newTestHandlers(t, manager, stubObserver{}, homePaths))
335 recorder := performRequest(
336 t,
337 engine,
338 http.MethodGet,
339 "/api/workspaces/ws-workspace/hooks/runs?session=sess-hook&last=-1",
340 nil,
341 )
342 if recorder.Code != http.StatusBadRequest {
343 t.Fatalf("status = %d, want %d; body=%s", recorder.Code, http.StatusBadRequest, recorder.Body.String())
344 }
345}
346
347func TestHookEventsHandlerReturnsPayloads(t *testing.T) {
348 t.Parallel()

Callers

nothing calls this directly

Calls 6

newTestHomePathsFunction · 0.70
newSessionInfoFunction · 0.70
newTestRouterFunction · 0.70
newTestHandlersFunction · 0.70
performRequestFunction · 0.70
StringMethod · 0.45

Tested by

no test coverage detected