| 1 | package e2e_test |
| 2 | |
| 3 | import ( |
| 4 | "net/url" |
| 5 | "os" |
| 6 | |
| 7 | "github.com/onsi/ginkgo/v2" |
| 8 | "github.com/onsi/gomega" |
| 9 | |
| 10 | "github.com/nicholas-fedor/shoutrrr/internal/testutils" |
| 11 | "github.com/nicholas-fedor/shoutrrr/pkg/services/sms/twilio" |
| 12 | ) |
| 13 | |
| 14 | var _ = ginkgo.Describe("Twilio E2E Service ID Test", func() { |
| 15 | ginkgo.When("running e2e tests", func() { |
| 16 | ginkgo.It("should return the correct service identifier", func() { |
| 17 | envURL := os.Getenv("SHOUTRRR_TWILIO_URL") |
| 18 | if envURL == "" { |
| 19 | ginkgo.Skip("SHOUTRRR_TWILIO_URL not set, skipping service ID test") |
| 20 | |
| 21 | return |
| 22 | } |
| 23 | |
| 24 | serviceURL, _ := url.Parse(envURL) |
| 25 | service := &twilio.Service{} |
| 26 | err := service.Initialize(serviceURL, testutils.TestLogger()) |
| 27 | gomega.Expect(err).NotTo(gomega.HaveOccurred()) |
| 28 | |
| 29 | gomega.Expect(service.GetID()).To(gomega.Equal("twilio")) |
| 30 | }) |
| 31 | }) |
| 32 | }) |