X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/80e348724041a694002fc38f57e8868b9b9a2be9..c781f79f3c8cb9a7577ee1574d196988da2719b3:/routes_test.go?ds=sidebyside diff --git a/routes_test.go b/routes_test.go index dda77ea..2aadc7e 100644 --- a/routes_test.go +++ b/routes_test.go @@ -88,6 +88,7 @@ func TestRoutesRefuseUnknownSourcesAndNonchildren(t *testing.T) { cause: "must be a child", }, } + for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { arguments := `{"source":"` + tc.source + `","agent":"` + tc.agent + `"}` @@ -122,6 +123,7 @@ func TestWhatsAppStatusListsRoutes(t *testing.T) { whatsapp.Command("status", func(text string) { answer = text }) + require.Contains(t, answer, "WhatsApp is not linked.") require.Contains(t, answer, "WhatsApp routes:\nwhatsapp:"+whatsappTestFamily.String()+" -> Garden") } @@ -144,6 +146,7 @@ func TestInvalidRouteFileStopsStartup(t *testing.T) { text: `{"whatsapp:example@lid":""}`, }, } + for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { path := filepath.Join(t.TempDir(), "routes.json")