(t *testing.T)
| 2477 | } |
| 2478 | |
| 2479 | func TestHandleMetaChanErr(t *testing.T) { |
| 2480 | topicName := "grpTest" |
| 2481 | chanName := "chnTest" |
| 2482 | numUsers := 3 |
| 2483 | helper := TopicTestHelper{} |
| 2484 | defer helper.tearDown() |
| 2485 | helper.setUp(t, numUsers, types.TopicCatGrp, topicName, false) |
| 2486 | |
| 2487 | // This is not a channel. However, we will try to handle an info message where |
| 2488 | // the topic is referenced as "chn". |
| 2489 | helper.topic.isChan = false |
| 2490 | // Empty message since this request should trigger an error anyway. |
| 2491 | meta := &ClientComMessage{ |
| 2492 | AsUser: helper.uids[0].UserId(), |
| 2493 | Original: chanName, |
| 2494 | MetaWhat: constMsgMetaDesc | constMsgMetaSub | constMsgMetaData | constMsgMetaDel, |
| 2495 | sess: helper.sessions[0], |
| 2496 | } |
| 2497 | helper.topic.handleMeta(meta) |
| 2498 | helper.finish() |
| 2499 | |
| 2500 | // Check for errors from testHubLoop |
| 2501 | if errorMsgs, hasError := helper.hubMessages["__ERROR__"]; hasError { |
| 2502 | t.Fatal(errorMsgs[0].Ctrl.Text) |
| 2503 | } |
| 2504 | |
| 2505 | // Session output. |
| 2506 | registerSessionVerifyOutputs(t, helper.results[0], []int{http.StatusNotFound}) |
| 2507 | // Presence notifications. |
| 2508 | if len(helper.hubMessages) != 0 { |
| 2509 | t.Errorf("Hub messages recipients: expected 0, received %d", len(helper.hubMessages)) |
| 2510 | } |
| 2511 | } |
| 2512 | |
| 2513 | func TestHandleMetaGet(t *testing.T) { |
| 2514 | topicName := "usrMe" |
nothing calls this directly
no test coverage detected
searching dependent graphs…