Just verify that the calls to the channel() fn show up in the output channel list.
(t *testing.T)
| 79 | |
| 80 | // Just verify that the calls to the channel() fn show up in the output channel list. |
| 81 | func TestSyncFunctionTakesArray(t *testing.T) { |
| 82 | ctx := base.TestCtx(t) |
| 83 | mapper := NewChannelMapper(ctx, `function(doc) {channel(["foo", "bar ok","baz"])}`, 0) |
| 84 | res, err := mapper.MapToChannelsAndAccess(ctx, parse(t, `{"channels": []}`), `{}`, emptyMetaMap(), noUser) |
| 85 | assert.NoError(t, err, "MapToChannelsAndAccess failed") |
| 86 | assert.Equal(t, BaseSetOf(t, "foo", "bar ok", "baz"), res.Channels) |
| 87 | } |
| 88 | |
| 89 | // Calling channel() with an invalid channel name should return an error. |
| 90 | func TestSyncFunctionRejectsInvalidChannels(t *testing.T) { |
nothing calls this directly
no test coverage detected