fix: TestImageMessageSharing (#2874)

This commit is contained in:
Richard Ramos 2022-09-21 09:48:04 -04:00 committed by GitHub
parent 698c32f3e3
commit 965e026cd9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 2 deletions

View File

@ -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")
}