From 98f3d2c87c1bf679d3c0b3d1024603c673c25896 Mon Sep 17 00:00:00 2001 From: Roland Osborne Date: Sat, 5 Mar 2022 13:52:42 -0800 Subject: [PATCH] testing removing contact from channel --- net/server/internal/ucMessangerApp_test.go | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/net/server/internal/ucMessangerApp_test.go b/net/server/internal/ucMessangerApp_test.go index 4e9f827b..0909c6dc 100644 --- a/net/server/internal/ucMessangerApp_test.go +++ b/net/server/internal/ucMessangerApp_test.go @@ -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 + })) }