1
0
forked from baron/baron-sso

fix(backend): fix UserGroup model and NewTenantService signature in bootstrap and tests

This commit is contained in:
2026-03-04 14:31:05 +09:00
parent 9ac99d2e0c
commit 0a784e5534
4 changed files with 14 additions and 12 deletions

View File

@@ -13,7 +13,7 @@ import (
func TestTenantService_RegisterTenant_DuplicateSlug(t *testing.T) {
mockRepo := new(MockTenantRepoForSvc)
svc := NewTenantService(mockRepo, nil, nil)
svc := NewTenantService(mockRepo, nil, nil, nil)
ctx := context.Background()
slug := "duplicate-slug"
@@ -28,7 +28,7 @@ func TestTenantService_RegisterTenant_DuplicateSlug(t *testing.T) {
}
func TestTenantService_RegisterTenant_InvalidSlug(t *testing.T) {
svc := NewTenantService(nil, nil, nil)
svc := NewTenantService(nil, nil, nil, nil)
ctx := context.Background()
// Case 1: Too short
@@ -41,7 +41,7 @@ func TestTenantService_RegisterTenant_InvalidSlug(t *testing.T) {
}
func TestTenantService_RequestRegistration_EmailMismatch(t *testing.T) {
svc := NewTenantService(nil, nil, nil)
svc := NewTenantService(nil, nil, nil, nil)
ctx := context.Background()
// admin email domain (gmail.com) != tenant domain (company.com)
@@ -53,7 +53,7 @@ func TestTenantService_RequestRegistration_EmailMismatch(t *testing.T) {
func TestTenantService_ApproveTenant_NotFound(t *testing.T) {
mockRepo := new(MockTenantRepoForSvc)
svc := NewTenantService(mockRepo, nil, nil)
svc := NewTenantService(mockRepo, nil, nil, nil)
ctx := context.Background()
id := "non-existent-id"
@@ -67,7 +67,7 @@ func TestTenantService_ApproveTenant_NotFound(t *testing.T) {
func TestTenantService_GetTenantByDomain_Inactive(t *testing.T) {
mockRepo := new(MockTenantRepoForSvc)
svc := NewTenantService(mockRepo, nil, nil)
svc := NewTenantService(mockRepo, nil, nil, nil)
ctx := context.Background()
domainName := "inactive.com"
@@ -88,7 +88,7 @@ func TestTenantService_ApproveTenant_UserNotFound(t *testing.T) {
mockUserRepo := new(MockUserRepoForTenant)
mockOutbox := new(MockKetoOutboxRepositoryShared)
svc := NewTenantService(mockRepo, mockUserRepo, mockOutbox)
svc := NewTenantService(mockRepo, mockUserRepo, nil, mockOutbox)
ctx := context.Background()
tenantID := "t1"
adminEmail := "notfound@tenant.com"