From 965e026cd96bf36578d7f49d4f72297ce1495cd5 Mon Sep 17 00:00:00 2001 From: Richard Ramos Date: Wed, 21 Sep 2022 09:48:04 -0400 Subject: [PATCH] fix: TestImageMessageSharing (#2874) --- protocol/messenger_share_image_test.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/protocol/messenger_share_image_test.go b/protocol/messenger_share_image_test.go index aa7c023e9..bd12661d2 100644 --- a/protocol/messenger_share_image_test.go +++ b/protocol/messenger_share_image_test.go @@ -119,6 +119,17 @@ func (s *MessengerShareMessageSuite) TestImageMessageSharing() { s.Require().NoError(err) s.Require().Len(response.Messages(), 1) + response, err = WaitOnMessengerResponse( + theirMessenger, + func(r *MessengerResponse) bool { return len(r.messages) > 0 }, + "no messages", + ) + + s.Require().NoError(err) + s.Require().Len(response.Chats(), 1) + s.Require().Len(response.Messages(), 1) + s.Require().Equal(response.Messages()[0].Text, "An image") + shareResponse, err := s.m.ShareImageMessage( &requests.ShareImageMessage{ MessageID: MessageID, @@ -135,8 +146,9 @@ func (s *MessengerShareMessageSuite) TestImageMessageSharing() { func(r *MessengerResponse) bool { return len(r.messages) > 0 }, "no messages", ) + s.Require().NoError(err) s.Require().Len(response.Chats(), 1) - s.Require().Len(response.Messages(), 2) - + s.Require().Len(response.Messages(), 1) + s.Require().Equal(response.Messages()[0].Text, "This message has been shared with you") }