MCPcopy
hub / github.com/tinode/chat / TestChannelsForUser

Function TestChannelsForUser

server/db/postgres/tests/postgres_test.go:513–523  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

511}
512
513func TestChannelsForUser(t *testing.T) {
514 // Test channels for user (PostgreSQL specific test)
515 channels, err := adp.ChannelsForUser(types.ParseUserId("usr" + testData.Users[0].Id))
516 if err != nil {
517 t.Fatal(err)
518 }
519 // Should return empty slice since we don't have channel subscriptions in test data
520 if len(channels) != 0 {
521 t.Error(mismatchErrorString("Channels length", len(channels), 0))
522 }
523}
524
525func TestSubscriptionGet(t *testing.T) {
526 got, err := adp.SubscriptionGet(testData.Topics[0].Id, types.ParseUserId("usr"+testData.Users[0].Id), false)

Callers

nothing calls this directly

Calls 4

ParseUserIdFunction · 0.92
ErrorMethod · 0.80
mismatchErrorStringFunction · 0.70
ChannelsForUserMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…