testing removing contact from channel

This commit is contained in:
Roland Osborne 2022-03-05 13:52:42 -08:00
parent 9b5dcdfe3f
commit 98f3d2c87c

View File

@ -252,5 +252,27 @@ func TestMessangerApp(t *testing.T) {
return false
}))
// unshare channel with A
params = &TestApiParams{
restType: "DELETE",
query: "/content/channels/{channelId}/cards/{cardId}",
path: map[string]string{ "cardId": set.B.A.CardId, "channelId": channel.Id },
tokenType: APP_TOKENAPP,
token: set.B.Token,
}
response = &TestApiResponse{}
assert.NoError(t, TestApiRequest(ClearChannelCard, params, response))
// wait for test
assert.NoError(t, app.WaitFor(func(testApp *TestApp)bool {
contact, contactSet := testApp.contacts[set.A.B.CardId]
if contactSet {
_, channelSet := contact.channels[channel.Id]
if !channelSet {
return true
}
}
return false
}))
}