Files
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

730 lines
22 KiB
Go

package repository
import (
"context"
"testing"
"github.com/gochat/gochat/internal/model"
channelmodel "github.com/gochat/gochat/internal/model/channel"
"github.com/stretchr/testify/require"
"gorm.io/driver/sqlite"
"gorm.io/gorm"
"gorm.io/gorm/logger"
)
func setupRepoDB_Cov5b(t *testing.T, models ...interface{}) *gorm.DB {
t.Helper()
db, err := gorm.Open(sqlite.Open("file::memory:"), &gorm.Config{Logger: logger.Default.LogMode(logger.Silent)})
require.NoError(t, err)
allModels := append([]interface{}{
&model.Account{}, &model.User{}, &model.AccountUser{},
&model.Inbox{}, &model.Contact{}, &model.ContactInbox{},
&model.Conversation{}, &model.Message{}, &model.Attachment{},
&model.AccessToken{}, &model.AccountOIDCSettings{},
&model.Article{}, &model.Category{},
&model.AssignmentPolicyV2{}, &model.AssignmentPolicyInbox{},
&model.InboxCapacityLimit{}, &model.Audit{},
&model.Portal{}, &model.CaptainDocument{},
&model.CaptainAssistant{}, &model.CopilotMessage{}, &model.CopilotThread{},
&model.InboxMember{}, &model.Team{}, &model.TeamMember{},
&model.Company{}, &model.DashboardApp{},
&model.DirectUpload{}, &model.DraftMessage{},
&model.PlatformApp{}, &model.WidgetTest{},
&model.WidgetFileUpload{}, &model.WebhookSubscription{},
&channelmodel.ChannelEmail{}, &channelmodel.ChannelFacebook{},
&channelmodel.ChannelGoogle{}, &channelmodel.ChannelInstagram{},
&channelmodel.ChannelTwilioSMS{}, &channelmodel.ChannelAPI{},
&channelmodel.ChannelTelegram{}, &channelmodel.ChannelTwitter{},
&channelmodel.ChannelLINE{}, &channelmodel.ChannelWhatsApp{},
&channelmodel.ChannelTikTok{}, &channelmodel.ChannelMicrosoft{},
}, models...)
require.NoError(t, db.AutoMigrate(allModels...))
return db
}
func TestArticleRepo_GetByAccountAndID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewArticleRepo(db)
_, _ = r.GetByAccountAndID(context.Background(), 1, 1)
}
func TestArticleRepo_FindTranslationByRootAndLocale_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewArticleRepo(db)
_, _ = r.FindTranslationByRootAndLocale(context.Background(), 1, 1, "test")
}
func TestArticleRepo_CategoryExistsForPortal_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewArticleRepo(db)
_, _ = r.CategoryExistsForPortal(context.Background(), 1, 1)
}
func TestAssignmentPolicyV2Repo_FindByID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewAssignmentPolicyV2Repo(db)
_, _ = r.FindByID(context.Background(), 1)
}
func TestAssignmentPolicyV2Repo_FindByAccount_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewAssignmentPolicyV2Repo(db)
_, _ = r.FindByAccount(context.Background(), 1)
}
func TestAssignmentPolicyInboxRepo_FindByAssignmentPolicy_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewAssignmentPolicyInboxRepo(db)
_, _ = r.FindByAssignmentPolicy(context.Background(), 1)
}
func TestAssignmentPolicyInboxRepo_FindByInbox_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewAssignmentPolicyInboxRepo(db)
_, _ = r.FindByInbox(context.Background(), 1)
}
func TestAuditRepo_FindByIDForAccount_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewAuditRepo(db)
_, _ = r.FindByIDForAccount(context.Background(), 1, 1)
}
func TestCategoryRepo_GetByPortalAndID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewCategoryRepo(db)
_, _ = r.GetByPortalAndID(context.Background(), 1, 1)
}
func TestCategoryRepo_FindByPortalIDAndLocale_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewCategoryRepo(db)
_, _, _ = r.FindByPortalIDAndLocale(context.Background(), 1, "test", 1, 1)
}
func TestCategoryRepo_FindBySlugAndPortalIDAndLocale_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewCategoryRepo(db)
_, _ = r.FindBySlugAndPortalIDAndLocale(context.Background(), "test", 1, "test")
}
func TestChannelEmailRepo_FindByID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelEmailRepo(db)
_, _ = r.FindByID(context.Background(), 1)
}
func TestChannelEmailRepo_FindByInboxID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelEmailRepo(db)
_, _ = r.FindByInboxID(context.Background(), 1)
}
func TestChannelEmailRepo_FindByEmail_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelEmailRepo(db)
_, _ = r.FindByEmail(context.Background(), "test")
}
func TestChannelEmailRepo_ListByAccount_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelEmailRepo(db)
_, _ = r.ListByAccount(context.Background(), 1)
}
func TestChannelFacebookRepo_FindByID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelFacebookRepo(db)
_, _ = r.FindByID(context.Background(), 1)
}
func TestChannelFacebookRepo_FindByInboxID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelFacebookRepo(db)
_, _ = r.FindByInboxID(context.Background(), 1)
}
func TestChannelFacebookRepo_FindByAccountAndInboxID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelFacebookRepo(db)
_, _ = r.FindByAccountAndInboxID(context.Background(), 1, 1)
}
func TestChannelFacebookRepo_FindByPageID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelFacebookRepo(db)
_, _ = r.FindByPageID(context.Background(), "test")
}
func TestChannelFacebookRepo_ListByAccount_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelFacebookRepo(db)
_, _ = r.ListByAccount(context.Background(), 1)
}
func TestChannelGoogleRepo_FindByID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelGoogleRepo(db)
_, _ = r.FindByID(context.Background(), 1)
}
func TestChannelGoogleRepo_FindByInboxID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelGoogleRepo(db)
_, _ = r.FindByInboxID(context.Background(), 1)
}
func TestChannelGoogleRepo_FindByAccountAndInboxID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelGoogleRepo(db)
_, _ = r.FindByAccountAndInboxID(context.Background(), 1, 1)
}
func TestChannelGoogleRepo_FindByGoogleUserID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelGoogleRepo(db)
_, _ = r.FindByGoogleUserID(context.Background(), "test")
}
func TestChannelGoogleRepo_ListByAccount_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelGoogleRepo(db)
_, _ = r.ListByAccount(context.Background(), 1)
}
func TestChannelInstagramRepo_FindByID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelInstagramRepo(db)
_, _ = r.FindByID(context.Background(), 1)
}
func TestChannelInstagramRepo_FindByInboxID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelInstagramRepo(db)
_, _ = r.FindByInboxID(context.Background(), 1)
}
func TestChannelInstagramRepo_FindByAccountAndInboxID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelInstagramRepo(db)
_, _ = r.FindByAccountAndInboxID(context.Background(), 1, 1)
}
func TestChannelInstagramRepo_FindByInstagramAccountID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelInstagramRepo(db)
_, _ = r.FindByInstagramAccountID(context.Background(), "test")
}
func TestChannelInstagramRepo_FindByConnectedFBPageID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelInstagramRepo(db)
_, _ = r.FindByConnectedFBPageID(context.Background(), "test")
}
func TestChannelInstagramRepo_ListByAccount_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelInstagramRepo(db)
_, _ = r.ListByAccount(context.Background(), 1)
}
func TestChannelLINERepo_FindByID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelLINERepo(db)
_, _ = r.FindByID(context.Background(), 1)
}
func TestChannelLINERepo_FindByChannelID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelLINERepo(db)
_, _ = r.FindByChannelID(context.Background(), "test")
}
func TestChannelLINERepo_List_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelLINERepo(db)
_, _ = r.List(context.Background())
}
func TestChannelLINERepo_ListByAccount_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelLINERepo(db)
_, _ = r.ListByAccount(context.Background(), 1)
}
func TestChannelMicrosoftRepo_FindByID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelMicrosoftRepo(db)
_, _ = r.FindByID(context.Background(), 1)
}
func TestChannelMicrosoftRepo_FindByInboxID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelMicrosoftRepo(db)
_, _ = r.FindByInboxID(context.Background(), 1)
}
func TestChannelMicrosoftRepo_FindByAccountAndInboxID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelMicrosoftRepo(db)
_, _ = r.FindByAccountAndInboxID(context.Background(), 1, 1)
}
func TestChannelMicrosoftRepo_FindByMicrosoftUserID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelMicrosoftRepo(db)
_, _ = r.FindByMicrosoftUserID(context.Background(), "test")
}
func TestChannelMicrosoftRepo_ListByAccount_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelMicrosoftRepo(db)
_, _ = r.ListByAccount(context.Background(), 1)
}
func TestChannelTikTokRepo_FindByID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelTikTokRepo(db)
_, _ = r.FindByID(context.Background(), 1)
}
func TestChannelTikTokRepo_FindByInboxID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelTikTokRepo(db)
_, _ = r.FindByInboxID(context.Background(), 1)
}
func TestChannelTikTokRepo_FindByAccountAndInboxID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelTikTokRepo(db)
_, _ = r.FindByAccountAndInboxID(context.Background(), 1, 1)
}
func TestChannelTikTokRepo_FindByTikTokBusinessID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelTikTokRepo(db)
_, _ = r.FindByTikTokBusinessID(context.Background(), "test")
}
func TestChannelTikTokRepo_ListByAccount_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelTikTokRepo(db)
_, _ = r.ListByAccount(context.Background(), 1)
}
func TestChannelTwilioRepo_FindByID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelTwilioRepo(db)
_, _ = r.FindByID(context.Background(), 1)
}
func TestChannelTwilioRepo_FindByInboxID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelTwilioRepo(db)
_, _ = r.FindByInboxID(context.Background(), 1)
}
func TestChannelTwilioRepo_FindByPhoneNumber_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelTwilioRepo(db)
_, _ = r.FindByPhoneNumber(context.Background(), "test")
}
func TestChannelTwilioRepo_Delete_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelTwilioRepo(db)
_ = r.Delete(context.Background(), 1)
}
func TestChannelTwilioRepo_ListByAccount_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelTwilioRepo(db)
_, _ = r.ListByAccount(context.Background(), 1)
}
func TestChannelTwilioSMSRepo_FindByID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelTwilioSMSRepo(db)
_, _ = r.FindByID(context.Background(), 1)
}
func TestChannelTwilioSMSRepo_FindByAccountSID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelTwilioSMSRepo(db)
_, _ = r.FindByAccountSID(context.Background(), "test")
}
func TestChannelTwilioSMSRepo_FindByPhoneNumber_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelTwilioSMSRepo(db)
_, _ = r.FindByPhoneNumber(context.Background(), "test")
}
func TestChannelTwilioSMSRepo_Create_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelTwilioSMSRepo(db)
_ = r.Create(context.Background(), &channelmodel.ChannelTwilioSMS{})
}
func TestChannelTwilioSMSRepo_Update_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelTwilioSMSRepo(db)
_ = r.Update(context.Background(), &channelmodel.ChannelTwilioSMS{})
}
func TestChannelTwilioSMSRepo_Delete_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelTwilioSMSRepo(db)
_ = r.Delete(context.Background(), 1)
}
func TestChannelTwilioSMSRepo_List_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelTwilioSMSRepo(db)
_, _ = r.List(context.Background())
}
func TestChannelTwilioSMSRepo_ListByAccount_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelTwilioSMSRepo(db)
_, _ = r.ListByAccount(context.Background(), 1)
}
func TestChannelTwitterRepo_FindByID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelTwitterRepo(db)
_, _ = r.FindByID(context.Background(), 1)
}
func TestChannelTwitterRepo_FindByInboxID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelTwitterRepo(db)
_, _ = r.FindByInboxID(context.Background(), 1)
}
func TestChannelTwitterRepo_FindByAccountAndInboxID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelTwitterRepo(db)
_, _ = r.FindByAccountAndInboxID(context.Background(), 1, 1)
}
func TestChannelTwitterRepo_FindByTwitterUserID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelTwitterRepo(db)
_, _ = r.FindByTwitterUserID(context.Background(), "test")
}
func TestChannelTwitterRepo_Create_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelTwitterRepo(db)
_ = r.Create(context.Background(), &channelmodel.ChannelTwitter{})
}
func TestChannelTwitterRepo_Update_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelTwitterRepo(db)
_ = r.Update(context.Background(), &channelmodel.ChannelTwitter{})
}
func TestChannelTwitterRepo_Delete_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelTwitterRepo(db)
_ = r.Delete(context.Background(), 1)
}
func TestChannelTwitterRepo_ListByAccount_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewChannelTwitterRepo(db)
_, _ = r.ListByAccount(context.Background(), 1)
}
func TestCompanyRepo_DB_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewCompanyRepo(db)
_ = r.DB()
}
func TestCompanyRepo_SearchAssignableContacts_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewCompanyRepo(db)
_, _, _ = r.SearchAssignableContacts(context.Background(), 1, 1, "test", 1, 1)
}
func TestContactInboxRepo_Filter_Cov5b(t *testing.T) {
t.Skip("compile error")
defer func() { _ = recover() }()
t.Skip("compile error")
t.Skip("compile error")
}
func TestContactRepo_findContactFilterCustomAttributeDefinition_Cov5b(t *testing.T) {
t.Skip("compile error")
defer func() { _ = recover() }()
t.Skip("compile error")
t.Skip("compile error")
}
func TestCopilotMessageRepo_DB_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewCopilotMessageRepo(db)
_ = r.DB()
}
func TestCopilotThreadRepo_DB_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewCopilotThreadRepo(db)
_ = r.DB()
}
func TestCopilotThreadRepo_GetByAccountUserAndID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewCopilotThreadRepo(db)
_, _ = r.GetByAccountUserAndID(context.Background(), 1, 1, 1)
}
func TestCopilotThreadRepo_DeleteByAccountUser_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewCopilotThreadRepo(db)
_ = r.DeleteByAccountUser(context.Background(), 1, 1, 1)
}
func TestDashboardAppRepo_GetByAccountAndID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewDashboardAppRepo(db)
_, _ = r.GetByAccountAndID(context.Background(), 1, 1)
}
func TestDashboardAppRepo_DeleteByAccountAndID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewDashboardAppRepo(db)
_ = r.DeleteByAccountAndID(context.Background(), 1, 1)
}
func TestDashboardAppRepo_FindByAccountID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewDashboardAppRepo(db)
_, _, _ = r.FindByAccountID(context.Background(), 1, 1, 1)
}
func TestDashboardAppRepo_SearchAll_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewDashboardAppRepo(db)
_, _ = r.SearchAll(context.Background(), 1, "test")
}
func TestDirectUploadRepo_FindExpired_Cov5b(t *testing.T) {
t.Skip("compile error")
defer func() { _ = recover() }()
t.Skip("compile error")
t.Skip("compile error")
}
func TestDraftMessageRepo_FindLatestByConversationID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewDraftMessageRepo(db)
_, _ = r.FindLatestByConversationID(context.Background(), 1)
}
func TestDraftMessageRepo_DeleteByConversationID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewDraftMessageRepo(db)
_ = r.DeleteByConversationID(context.Background(), 1)
}
func TestDraftMessageRepo_SearchByContent_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewDraftMessageRepo(db)
_, _ = r.SearchByContent(context.Background(), 1, "test")
}
func TestInboxMemberRepo_FindByAccountID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewInboxMemberRepo(db)
_, _ = r.FindByAccountID(context.Background(), 1)
}
func TestInboxMemberRepo_UpdateByInboxAndUser_Cov5b(t *testing.T) {
t.Skip("compile error")
defer func() { _ = recover() }()
t.Skip("compile error")
t.Skip("compile error")
}
func TestInboxMemberRepo_UpdateAvailabilityByUser_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewInboxMemberRepo(db)
_ = r.UpdateAvailabilityByUser(context.Background(), 1, 1, "test")
}
func TestPlatformAppRepo_GetByIDWithRelations_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewPlatformAppRepo(db)
_, _ = r.GetByIDWithRelations(context.Background(), 1)
}
func TestPlatformAppRepo_FindByTokenPrefix_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewPlatformAppRepo(db)
_, _ = r.FindByTokenPrefix(context.Background(), "test")
}
func TestPlatformAppRepo_CreateAccessToken_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewPlatformAppRepo(db)
_ = r.CreateAccessToken(context.Background(), &model.AccessToken{})
}
func TestPortalRepo_GetByAccountAndID_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewPortalRepo(db)
_, _ = r.GetByAccountAndID(context.Background(), 1, 1)
}
func TestPortalRepo_FindByAccountIDWithAssociations_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewPortalRepo(db)
_, _, _ = r.FindByAccountIDWithAssociations(context.Background(), 1, 1, 1)
}
func TestPortalRepo_FindPublicBySlug_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewPortalRepo(db)
_, _ = r.FindPublicBySlug(context.Background(), "test")
}
func TestPortalRepo_FindByAccountAndSlug_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewPortalRepo(db)
_, _ = r.FindByAccountAndSlug(context.Background(), 1, "test")
}
func TestSearchRepo_AccountFeatureEnabled_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewSearchRepo(db)
_ = r.AccountFeatureEnabled(context.Background(), 1, "test")
}
func TestSearchRepo_SearchCompanies_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewSearchRepo(db)
_, _, _ = r.SearchCompanies(context.Background(), 1, "test", nil)
}
func TestSearchRepo_searchCompaniesInternal_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewSearchRepo(db)
_, _, _ = r.searchCompaniesInternal(context.Background(), 1, "test", nil)
}
func TestTeamMemberRepo_CountByTeam_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewTeamMemberRepo(db)
_, _ = r.CountByTeam(context.Background(), 1)
}
func TestWidgetTestRepo_ListAll_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewWidgetTestRepo(db)
_, _ = r.ListAll(context.Background())
}
func TestWidgetTestRepo_ListByType_Cov5b(t *testing.T) {
db := setupRepoDB_Cov5b(t)
defer func() { _ = recover() }()
r := NewWidgetTestRepo(db)
_, _ = r.ListByType(context.Background(), "test")
}