| 140 | } |
| 141 | |
| 142 | func TestFeedback_WhitespaceOnlyMessage(t *testing.T) { |
| 143 | server, _, _ := setupAPI(t) |
| 144 | |
| 145 | payload := `{"email":"","category":"general","message":" \n\t "}` |
| 146 | resp, _ := http.Post(server.URL+"/api/feedback", "application/json", bytes.NewBufferString(payload)) |
| 147 | defer resp.Body.Close() |
| 148 | |
| 149 | if resp.StatusCode != 400 { |
| 150 | t.Errorf("status = %d, want 400 for whitespace-only message", resp.StatusCode) |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | func TestFeedback_InvalidCategory(t *testing.T) { |
| 155 | server, _, _ := setupAPI(t) |