Skip to content

Commit

Permalink
fix: too many list message items panic in test
Browse files Browse the repository at this point in the history
  • Loading branch information
paulobernardoaf committed Dec 11, 2024
1 parent 480077c commit 083fdbd
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions handlers/facebookapp/facebookapp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1078,11 +1078,21 @@ var SendTestCasesWAC = []ChannelSendTestCase{
Text: "Interactive Button Msg", URN: "whatsapp:250788123123", QuickReplies: []string{"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"},
Error: "too many quick replies WAC supports only up to 10 quick replies",
SendPrep: setSendURL},
{Label: "Interactive Button Message Send with too many replies and attachments",
{Label: "Interactive Button Message Send with too many replies and attachments", // TODO: attachment is sent, but the list message fails, is this correct?
Text: "Interactive Button Msg", URN: "whatsapp:250788123123", QuickReplies: []string{"1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11"},
Attachments: []string{"image/jpeg:https://foo.bar/image.jpg"},
Error: "too many quick replies WAC supports only up to 10 quick replies",
SendPrep: setSendURL},
Responses: map[MockedRequest]MockedResponse{
{
Method: "POST",
Path: "/12345_ID/messages",
Body: `{"messaging_product":"whatsapp","recipient_type":"individual","to":"250788123123","type":"image","image":{"link":"https://foo.bar/image.jpg"}}`,
}: {
Status: 201,
Body: `{ "messages": [{"id": "157b5e14568e8"}] }`,
},
},
SendPrep: setSendURL},
{Label: "Mesage without text and with quick replies and attachments should not be sent",
Text: "", URN: "whatsapp:250788123123",
QuickReplies: []string{"Yes", "No"},
Expand Down

0 comments on commit 083fdbd

Please sign in to comment.