X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/a6a82d96b4906e9e1f09f45f69f48124f11ae1bb..b1095a9efc2d57d0c13a043f3feaddbdec789512:/whatsapp_fake_helper_test.go diff --git a/whatsapp_fake_helper_test.go b/whatsapp_fake_helper_test.go index 3d7d117..ee5321e 100644 --- a/whatsapp_fake_helper_test.go +++ b/whatsapp_fake_helper_test.go @@ -352,3 +352,16 @@ func whatsappTestConnect(t *testing.T, fake *WhatsAppFake) { require.True(t, fake.Emit(&events.Connected{})) require.True(t, fake.Emit(&events.OfflineSyncCompleted{})) } + +// whatsappTestContacts puts the contacts of the tests into the session of +// whatsapp: Ana Souza, Joao Silva with an accent, a business, and the user. +func whatsappTestContacts(t *testing.T, whatsapp *WhatsApp) { + t.Helper() + + contacts := whatsapp.device.Contacts + require.NoError(t, contacts.PutContactName(t.Context(), whatsappTestAna, "Ana", "Ana Souza")) + require.NoError(t, contacts.PutContactName(t.Context(), types.NewJID("15550004444", types.DefaultUserServer), "João", "João Silva")) + _, _, err := contacts.PutBusinessName(t.Context(), types.NewJID("15550005555", types.DefaultUserServer), "Corner Bakery") + require.NoError(t, err) + require.NoError(t, contacts.PutContactName(t.Context(), whatsappTestOwn, "Me", "Me Souza")) +}