(t *testing.T)
| 277 | } |
| 278 | |
| 279 | func TestWebSocketSubscribeNonexistentTopicError(t *testing.T) { |
| 280 | ensureServer() |
| 281 | token := signUpAndGetToken(t) |
| 282 | |
| 283 | ws := dialWS(t, token) |
| 284 | defer ws.Close() |
| 285 | |
| 286 | id := nextReqId() |
| 287 | sendJSON(t, ws, wsPayload{ |
| 288 | Id: id, |
| 289 | Method: "subscribe", |
| 290 | Payload: map[string]interface{}{"topicName": "nonexistent_topic_xyz_12345"}, |
| 291 | }) |
| 292 | |
| 293 | msg := recvJSON(t, ws, 5*time.Second) |
| 294 | if msg.Type != "response" { |
| 295 | t.Errorf("expected type=response, got %q", msg.Type) |
| 296 | } |
| 297 | if msg.Ok == nil || *msg.Ok { |
| 298 | t.Errorf("expected ok=false, got %v", msg.Ok) |
| 299 | } |
| 300 | if msg.Method != "subscribe" { |
| 301 | t.Errorf("expected method=subscribe, got %q", msg.Method) |
| 302 | } |
| 303 | } |
| 304 | |
| 305 | func TestWebSocketUnsubscribeAck(t *testing.T) { |
| 306 | ensureServer() |
nothing calls this directly
no test coverage detected