MCPcopy Create free account
hub / github.com/GetStream/stream-cli / TestUpdateChannel

Function TestUpdateChannel

pkg/cmd/chat/channel/channel_test.go:74–90  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

72}
73
74func TestUpdateChannel(t *testing.T) {
75 cmd := test.GetRootCmdWithSubCommands(NewCmds()...)
76 ch := test.InitChannel(t)
77 t.Cleanup(func() {
78 test.DeleteChannel(ch)
79 })
80
81 cmd.SetArgs([]string{"update-channel", "-t", "messaging", "-i", ch, "-p", "{\"custom_property\":\"property-value\"}"})
82 _, err := cmd.ExecuteC()
83 require.NoError(t, err)
84
85 c := test.InitClient()
86 ctx := context.Background()
87 resp, err := c.Channel("messaging", ch).Query(ctx, &stream.QueryRequest{Data: &stream.ChannelRequest{}})
88 require.NoError(t, err)
89 require.Equal(t, "property-value", resp.Channel.ExtraData["custom_property"])
90}
91
92func TestUpdateChannelPartial(t *testing.T) {
93 cmd := test.GetRootCmdWithSubCommands(NewCmds()...)

Callers

nothing calls this directly

Calls 5

InitChannelFunction · 0.92
DeleteChannelFunction · 0.92
InitClientFunction · 0.92
NewCmdsFunction · 0.70

Tested by

no test coverage detected