(t *testing.T)
| 72 | } |
| 73 | |
| 74 | func 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 | |
| 92 | func TestUpdateChannelPartial(t *testing.T) { |
| 93 | cmd := test.GetRootCmdWithSubCommands(NewCmds()...) |
nothing calls this directly
no test coverage detected