Just verify that the calls to the access() fn show up in the output channel list.
(t *testing.T)
| 70 | |
| 71 | // Just verify that the calls to the access() fn show up in the output channel list. |
| 72 | func TestAccessFunction(t *testing.T) { |
| 73 | ctx := base.TestCtx(t) |
| 74 | mapper := NewChannelMapper(ctx, `function(doc) {access("foo", "bar"); access("foo", "baz")}`, 0) |
| 75 | res, err := mapper.MapToChannelsAndAccess(ctx, parse(t, `{}`), `{}`, emptyMetaMap(), noUser) |
| 76 | assert.NoError(t, err, "MapToChannelsAndAccess failed") |
| 77 | assert.Equal(t, AccessMap{"foo": BaseSetOf(t, "bar", "baz")}, res.Access) |
| 78 | } |
| 79 | |
| 80 | // Just verify that the calls to the channel() fn show up in the output channel list. |
| 81 | func TestSyncFunctionTakesArray(t *testing.T) { |
nothing calls this directly
no test coverage detected