X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/2e2524881dfe8f6c5cabfd9d342d5d3492953bd4..c76d3832afce8da932860294d27bd167bf8a928c:/whatsapp_find_test.go diff --git a/whatsapp_find_test.go b/whatsapp_find_test.go index 30f84ff..d642808 100644 --- a/whatsapp_find_test.go +++ b/whatsapp_find_test.go @@ -16,7 +16,7 @@ func TestWhatsAppFindMatchesNamesWithNoRegardToCaseAndAccents(t *testing.T) { { JID: whatsappTestFamily, GroupName: types.GroupName{ - Name: "Família Souza", + Name: "Souza Family", }, }, } @@ -38,15 +38,15 @@ func TestWhatsAppFindMatchesNamesWithNoRegardToCaseAndAccents(t *testing.T) { { name: "a part of a name finds contacts and groups", query: "SOUZA", - answer: "15550002222@s.whatsapp.net | Ana Souza | contact\n120363000000000001@g.us | Família Souza | group", + answer: "15550002222@s.whatsapp.net | Ana Souza | contact\n120363000000000001@g.us | Souza Family | group", }, { - name: "a business name", + name: "finds the business by its name", query: "bakery", answer: "15550005555@s.whatsapp.net | Corner Bakery | contact", }, { - name: "no match", + name: "reports that no name matches", query: "Zed", answer: "No contact or group has a name with \"Zed\".", }, @@ -99,10 +99,12 @@ func TestWhatsAppFindWithoutALink(t *testing.T) { func TestAgentFindsAWhatsAppContact(t *testing.T) { whatsapp, fake := whatsappStartTestLinked(t) whatsappTestContacts(t, whatsapp) + server := newModelFake(t) server.reply = func(w http.ResponseWriter, call ModelFakeCall) { if call.number == 0 { modelWriteEvents(w, modelCompletedEvent([]any{modelFunctionCallItem("fc_1", "call_1", "whatsapp_find", `{"name":"ana"}`)}, 100, 0, 5)) + return }