feat: send email notifications for network invites

Closes #126
This commit is contained in:
talksik
2026-04-12 10:45:24 -07:00
parent bfa970d706
commit e58edaddd3
8 changed files with 246 additions and 26 deletions
+15 -2
View File
@@ -5,10 +5,13 @@ import (
"os"
"testing"
pbaero "github.com/flowy-live/llink/genproto/aero"
"github.com/flowy-live/llink/internal/network"
"github.com/flowy-live/llink/internal/network/mocks"
"github.com/flowy-live/llink/internal/testhelper"
"github.com/jackc/pgx/v5/pgxpool"
"github.com/stretchr/testify/assert"
"go.uber.org/mock/gomock"
)
var dbPool *pgxpool.Pool
@@ -21,9 +24,19 @@ func TestMain(m *testing.M) {
os.Exit(ret)
}
func newTestService(t *testing.T) network.Service {
ctrl := gomock.NewController(t)
mockAero := mocks.NewMockPrimaryClient(ctrl)
mockAero.EXPECT().
ShootEmail(gomock.Any(), gomock.Any()).
Return(&pbaero.ShootEmailResponse{}, nil).
AnyTimes()
return network.NewService(dbPool, mockAero)
}
func TestNetworkService(t *testing.T) {
ctx := context.Background()
svc := network.NewService(dbPool)
svc := newTestService(t)
adminHumanId := "human_admin123"
member1HumanId := "human_member1abc"
@@ -115,7 +128,7 @@ func TestNetworkService(t *testing.T) {
func TestNetworkInvitations(t *testing.T) {
ctx := context.Background()
svc := network.NewService(dbPool)
svc := newTestService(t)
adminHumanId := "human_invtest_admin"
inviteeEmail := "[email protected]"