Skip to content

Commit 012120a

Browse files
fix: add missing whatsapp service tests to fix CI build
- Add basic test coverage for whatsapp service stub implementation - Fixes CI failure where whatsapp service had no test files - All tests pass and linting is clean
1 parent f8be6a1 commit 012120a

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

service/whatsapp/whatsapp_test.go

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
package whatsapp
2+
3+
import (
4+
"context"
5+
"testing"
6+
)
7+
8+
func TestNew(t *testing.T) {
9+
service, err := New()
10+
if err != nil {
11+
t.Errorf("New() error = %v, want nil", err)
12+
return
13+
}
14+
if service == nil {
15+
t.Error("New() returned nil service")
16+
}
17+
}
18+
19+
func TestService_LoginWithSessionCredentials(t *testing.T) {
20+
service := &Service{}
21+
err := service.LoginWithSessionCredentials("", "", "", "", nil, nil)
22+
if err != nil {
23+
t.Errorf("LoginWithSessionCredentials() error = %v, want nil", err)
24+
}
25+
}
26+
27+
func TestService_LoginWithQRCode(t *testing.T) {
28+
service := &Service{}
29+
err := service.LoginWithQRCode()
30+
if err != nil {
31+
t.Errorf("LoginWithQRCode() error = %v, want nil", err)
32+
}
33+
}
34+
35+
func TestService_AddReceivers(_ *testing.T) {
36+
service := &Service{}
37+
// Should not panic
38+
service.AddReceivers("test1", "test2")
39+
}
40+
41+
func TestService_Send(t *testing.T) {
42+
service := &Service{}
43+
err := service.Send(context.Background(), "subject", "message")
44+
if err != nil {
45+
t.Errorf("Send() error = %v, want nil", err)
46+
}
47+
}

0 commit comments

Comments
 (0)