(t *testing.T)
| 322 | } |
| 323 | |
| 324 | func 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 | |
| 347 | func TestHookEventsHandlerReturnsPayloads(t *testing.T) { |
| 348 | t.Parallel() |
nothing calls this directly
no test coverage detected