X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/c781f79f3c8cb9a7577ee1574d196988da2719b3..d7bc0a6ac452bfc646610fdfd7c8eccb5c55218f:/whatsapp_send_test.go?ds=sidebyside diff --git a/whatsapp_send_test.go b/whatsapp_send_test.go index a2e9a92..977d06b 100644 --- a/whatsapp_send_test.go +++ b/whatsapp_send_test.go @@ -147,35 +147,35 @@ func TestWhatsAppSendRefuses(t *testing.T) { err string }{ { - name: "no id", + name: "refuses no id", id: " ", chat: whatsappTestAna.String(), text: "hi", err: "the id must have 1 to 100 bytes", }, { - name: "no text", + name: "refuses no text", id: "a", chat: whatsappTestAna.String(), text: "", err: "the text must have 1 to 65536 bytes", }, { - name: "a name for a chat", + name: "refuses a name for a chat", id: "a", chat: "Ana Souza", text: "hi", err: `"Ana Souza" is not the ID of a WhatsApp chat: find the ID with whatsapp_find`, }, { - name: "a status broadcast", + name: "refuses a status broadcast", id: "a", chat: types.StatusBroadcastJID.String(), text: "hi", err: `"status@broadcast" is not a private chat or a group`, }, { - name: "the chat of the user", + name: "refuses the chat of the user", id: "a", chat: whatsappTestOwn.String(), text: "hi", @@ -190,7 +190,7 @@ func TestWhatsAppSendRefuses(t *testing.T) { for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { _, err := whatsapp.Send(t.Context(), tc.id, tc.chat, tc.text, "") - require.EqualError(t, err, tc.err) + require.EqualError(t, err, "check WhatsApp send: "+tc.err) }) }