getListWithChatHeader sends a GET /list request with the Coder-Chat-Id header set and returns the recorder.
(t *testing.T, handler http.Handler, chatID string)
| 715 | // getListWithChatHeader sends a GET /list request with the |
| 716 | // Coder-Chat-Id header set and returns the recorder. |
| 717 | func getListWithChatHeader(t *testing.T, handler http.Handler, chatID string) *httptest.ResponseRecorder { |
| 718 | t.Helper() |
| 719 | |
| 720 | ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong) |
| 721 | defer cancel() |
| 722 | |
| 723 | w := httptest.NewRecorder() |
| 724 | r := httptest.NewRequestWithContext(ctx, http.MethodGet, "/list", nil) |
| 725 | if chatID != "" { |
| 726 | r.Header.Set(workspacesdk.CoderChatIDHeader, chatID) |
| 727 | } |
| 728 | handler.ServeHTTP(w, r) |
| 729 | return w |
| 730 | } |
| 731 | |
| 732 | func TestProcessOutput(t *testing.T) { |
| 733 | t.Parallel() |
no test coverage detected