Files
gochat/backend/internal/service/coverage51_test.go
T
Rogeeandrogee 2b182f9956 H-300: wire Captain Skills into Web runtime (#48)
* H-300: wire Captain Skills into Web runtime

* H-300: enforce effective model and conservative skill budget

* H-300: fix CI gosec step

* ci: extend golangci-lint timeout

* fix lint findings across backend

* fix(push): resolve delivery protocol blockers

* test(repository): close SQLite test databases

* test(repository): reuse SQLite schema per package

* H-307: restore backend Go cache in CI

* H-307: prefetch modules before cold lint

* H-307: resolve govulncheck security gate

* H-307: build lint with patched Go toolchain

* H-307: clear remaining security scan findings

---------

Co-authored-by: Rogee <rogee@ipao.vip>
2026-08-19 07:08:14 +08:00

34 lines
1.2 KiB
Go

package service
import (
"testing"
"github.com/gochat/gochat/internal/model"
)
// Test buildProfileConfirmationMailRequest - it's a pure function
func TestBuildProfileConfirmationMailRequest_Full_Cov51(t *testing.T) {
user := &model.User{Name: "John", Email: "john@example.com"}
account := &model.Account{Name: "Acme"}
inviter := &model.User{Name: "Admin"}
req := buildProfileConfirmationMailRequest(user, account, inviter, "Acme", "https://app.example.com", "token123", "reset456")
if req.ToEmail != "john@example.com" {
t.Errorf("expected john@example.com, got %s", req.ToEmail)
}
}
func TestBuildProfileConfirmationMailRequest_EmptyName_Cov51(t *testing.T) {
user := &model.User{Name: "", Email: "john@example.com"}
account := &model.Account{Name: "Acme"}
req := buildProfileConfirmationMailRequest(user, account, nil, "Acme", "https://app.example.com", "token", "reset")
// Should use email as recipient name when name is empty
_ = req
}
func TestBuildProfileConfirmationMailRequest_NoInviter_Cov51(t *testing.T) {
user := &model.User{Name: "John", Email: "john@example.com"}
account := &model.Account{Name: "Acme"}
req := buildProfileConfirmationMailRequest(user, account, nil, "Acme", "https://app.example.com", "token", "reset")
_ = req
}