X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/80e348724041a694002fc38f57e8868b9b9a2be9..c781f79f3c8cb9a7577ee1574d196988da2719b3:/whatsapp_test.go diff --git a/whatsapp_test.go b/whatsapp_test.go index 9ed4105..05ea123 100644 --- a/whatsapp_test.go +++ b/whatsapp_test.go @@ -124,6 +124,7 @@ func TestWhatsAppLinkedPairRequestKeepsFirstConnectionRetries(t *testing.T) { test.whatsapp.Command("pair 15550001111", func(text string) { answers <- text }) + require.Equal(t, "WhatsApp is linked already. Run /whatsapp unlink first.", <-answers) synctest.Wait() test.fake.mutex.Lock() @@ -194,6 +195,7 @@ func TestWhatsAppPairsAfterFirstConnectionRetriesStop(t *testing.T) { synctest.Wait() test.whatsapp.Command("unlink", func(_ string) { }) + synctest.Wait() require.False(t, test.whatsapp.isLinked()) @@ -316,6 +318,7 @@ func TestWhatsAppLogsEachChangeOfTheConnectionOnce(t *testing.T) { "<4>disconnected, retrying", "<6>connected again after=1m25s", }, strings.Split(strings.TrimSuffix(logs.String(), "\n"), "\n")) + require.NotContains(t, logs.String(), whatsappTestNumber) require.NotContains(t, logs.String(), whatsappTestLID) } @@ -663,6 +666,7 @@ func TestWhatsAppLogsNoOwnNumber(t *testing.T) { require.Eventually(t, func() bool { return logs.String() != "" }, 10*time.Second, time.Millisecond) + require.Equal(t, "<4>first connect failed, retrying: no route for OWN@s.whatsapp.net and OWN@lid\n", logs.String()) }