5120 lines
195 KiB
Go
5120 lines
195 KiB
Go
package v1
|
|
|
|
import (
|
|
"net/http/httptest"
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func init() {
|
|
gin.SetMode(gin.TestMode)
|
|
}
|
|
|
|
func safeCall_Cov14(t *testing.T, f func()) {
|
|
defer func() { _ = recover() }()
|
|
f()
|
|
}
|
|
|
|
func newCtx_Cov14(method, path string) (*gin.Context, *httptest.ResponseRecorder) {
|
|
w := httptest.NewRecorder()
|
|
c, _ := gin.CreateTestContext(w)
|
|
c.Request = httptest.NewRequest(method, path, nil)
|
|
return c, w
|
|
}
|
|
|
|
func newCtxBody_Cov14(method, path string, body string) (*gin.Context, *httptest.ResponseRecorder) {
|
|
w := httptest.NewRecorder()
|
|
c, _ := gin.CreateTestContext(w)
|
|
c.Request = httptest.NewRequest(method, path, strings.NewReader(body))
|
|
if body != "" {
|
|
c.Request.Header.Set("Content-Type", "application/json")
|
|
}
|
|
return c, w
|
|
}
|
|
|
|
func newCtxParams_Cov14(method, path string, params map[string]string) (*gin.Context, *httptest.ResponseRecorder) {
|
|
c, w := newCtx_Cov14(method, path)
|
|
for k, v := range params {
|
|
c.Params = append(c.Params, gin.Param{Key: k, Value: v})
|
|
}
|
|
return c, w
|
|
}
|
|
|
|
func newCtxParamsBody_Cov14(method, path string, params map[string]string, body string) (*gin.Context, *httptest.ResponseRecorder) {
|
|
c, w := newCtxBody_Cov14(method, path, body)
|
|
for k, v := range params {
|
|
c.Params = append(c.Params, gin.Param{Key: k, Value: v})
|
|
}
|
|
return c, w
|
|
}
|
|
|
|
func ctxWithAcct_Cov14(method, path string, accountID string) (*gin.Context, *httptest.ResponseRecorder) {
|
|
return newCtxParams_Cov14(method, path, map[string]string{"account_id": accountID})
|
|
}
|
|
|
|
func ctxWithAcctBody_Cov14(method, path string, accountID string, body string) (*gin.Context, *httptest.ResponseRecorder) {
|
|
return newCtxParamsBody_Cov14(method, path, map[string]string{"account_id": accountID}, body)
|
|
}
|
|
|
|
// ============ Constructor Tests ============
|
|
|
|
func TestCtor_AccountHandler_Cov14(t *testing.T) {
|
|
h := NewAccountHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_AgentBotHandler_Cov14(t *testing.T) {
|
|
h := NewAgentBotHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_AgentBotInboxHandler_Cov14(t *testing.T) {
|
|
h := NewAgentBotInboxHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_AgentBulkHandler_Cov14(t *testing.T) {
|
|
h := NewAgentBulkHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_AgentCapacityHandler_Cov14(t *testing.T) {
|
|
h := NewAgentCapacityHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_AgentHandler_Cov14(t *testing.T) {
|
|
h := NewAgentHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_AnalyticsHandler_Cov14(t *testing.T) {
|
|
h := NewAnalyticsHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_ArticleHandler_Cov14(t *testing.T) {
|
|
h := NewArticleHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_AssignableAgentHandler_Cov14(t *testing.T) {
|
|
h := NewAssignableAgentHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_AssignmentPolicyHandler_Cov14(t *testing.T) {
|
|
h := NewAssignmentPolicyHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_AssignmentPolicyV2Handler_Cov14(t *testing.T) {
|
|
h := NewAssignmentPolicyV2Handler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_AuditHandler_Cov14(t *testing.T) {
|
|
h := NewAuditHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_AuthHandler_Cov14(t *testing.T) {
|
|
h := NewAuthHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_BannerHandler_Cov14(t *testing.T) {
|
|
h := NewBannerHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_BotRuleHandler_Cov14(t *testing.T) {
|
|
h := NewBotRuleHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_BotTriggerConfigHandler_Cov14(t *testing.T) {
|
|
h := NewBotTriggerConfigHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_BulkActionHandler_Cov14(t *testing.T) {
|
|
h := NewBulkActionHandler(nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_CampaignHandler_Cov14(t *testing.T) {
|
|
h := NewCampaignHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_CannedResponseHandler_Cov14(t *testing.T) {
|
|
h := NewCannedResponseHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_CaptainAssistantHandler_Cov14(t *testing.T) {
|
|
h := NewCaptainAssistantHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_CaptainAssistantResponseHandler_Cov14(t *testing.T) {
|
|
h := NewCaptainAssistantResponseHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_CaptainBulkActionHandler_Cov14(t *testing.T) {
|
|
h := NewCaptainBulkActionHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_CaptainConversationHandler_Cov14(t *testing.T) {
|
|
h := NewCaptainConversationHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_CaptainCustomToolHandler_Cov14(t *testing.T) {
|
|
h := NewCaptainCustomToolHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_CaptainDocumentHandler_Cov14(t *testing.T) {
|
|
h := NewCaptainDocumentHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_CaptainPreferenceHandler_Cov14(t *testing.T) {
|
|
h := NewCaptainPreferenceHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_CaptainScenarioHandler_Cov14(t *testing.T) {
|
|
h := NewCaptainScenarioHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_CaptainTaskExtendedHandler_Cov14(t *testing.T) {
|
|
h := NewCaptainTaskExtendedHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_CaptainTaskHandler_Cov14(t *testing.T) {
|
|
h := NewCaptainTaskHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_CategoryHandler_Cov14(t *testing.T) {
|
|
h := NewCategoryHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_CompanyHandler_Cov14(t *testing.T) {
|
|
h := NewCompanyHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_ContactHandler_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_ContactInboxHandler_Cov14(t *testing.T) {
|
|
h := NewContactInboxHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_ContactMergeHandler_Cov14(t *testing.T) {
|
|
h := NewContactMergeHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_ConversationHandler_Cov14(t *testing.T) {
|
|
h := NewConversationHandler(nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_ConversationInsightHandler_Cov14(t *testing.T) {
|
|
h := NewConversationInsightHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_ConversationParticipantHandler_Cov14(t *testing.T) {
|
|
h := NewConversationParticipantHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_CopilotConfigHandler_Cov14(t *testing.T) {
|
|
h := NewCopilotConfigHandler(nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_CopilotHandler_Cov14(t *testing.T) {
|
|
h := NewCopilotHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_CsatMetricsHandler_Cov14(t *testing.T) {
|
|
h := NewCsatMetricsHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_CsatSurveyHandler_Cov14(t *testing.T) {
|
|
h := NewCsatSurveyHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_CustomAttributeDefinitionHandler_Cov14(t *testing.T) {
|
|
h := NewCustomAttributeDefinitionHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_CustomAttributeValueHandler_Cov14(t *testing.T) {
|
|
h := NewCustomAttributeValueHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_CustomFilterHandler_Cov14(t *testing.T) {
|
|
h := NewCustomFilterHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_CustomRoleHandler_Cov14(t *testing.T) {
|
|
h := NewCustomRoleHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_DashboardAppHandler_Cov14(t *testing.T) {
|
|
h := NewDashboardAppHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_DeliveryStatusHandler_Cov14(t *testing.T) {
|
|
h := NewDeliveryStatusHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_DraftMessageHandler_Cov14(t *testing.T) {
|
|
h := NewDraftMessageHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_DyteIntegrationHandler_Cov14(t *testing.T) {
|
|
h := NewDyteIntegrationHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_EmailChannelMigrationHandler_Cov14(t *testing.T) {
|
|
h := NewEmailChannelMigrationHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_EnterpriseAccountHandler_Cov14(t *testing.T) {
|
|
h := NewEnterpriseAccountHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_FacebookChannelHandler_Cov14(t *testing.T) {
|
|
h := NewFacebookChannelHandler(nil, nil, nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_FolderHandler_Cov14(t *testing.T) {
|
|
h := NewFolderHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_GoogleChannelHandler_Cov14(t *testing.T) {
|
|
h := NewGoogleChannelHandler(nil, nil, nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_InboxCsatTemplateHandler_Cov14(t *testing.T) {
|
|
h := NewInboxCsatTemplateHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_InboxHandler_Cov14(t *testing.T) {
|
|
h := NewInboxHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_InboxLimitHandler_Cov14(t *testing.T) {
|
|
h := NewInboxLimitHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_InboxMemberHandler_Cov14(t *testing.T) {
|
|
h := NewInboxMemberHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_InstallationConfigHandler_Cov14(t *testing.T) {
|
|
h := NewInstallationConfigHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_IntegrationHookHandler_Cov14(t *testing.T) {
|
|
h := NewIntegrationHookHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_InstagramChannelHandler_Cov14(t *testing.T) {
|
|
h := NewInstagramChannelHandler(nil, nil, nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_LabelHandler_Cov14(t *testing.T) {
|
|
h := NewLabelHandler(nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_LineChannelHandler_Cov14(t *testing.T) {
|
|
h := NewLINEChannelHandler(nil, nil, nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_LinearIntegrationHandler_Cov14(t *testing.T) {
|
|
h := NewLinearIntegrationHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_LiveReportHandler_Cov14(t *testing.T) {
|
|
h := NewLiveReportHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_MacroHandler_Cov14(t *testing.T) {
|
|
h := NewMacroHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_MessageHandler_Cov14(t *testing.T) {
|
|
h := NewMessageHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_MicrosoftChannelHandler_Cov14(t *testing.T) {
|
|
h := NewMicrosoftChannelHandler(nil, nil, nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_NoteHandler_Cov14(t *testing.T) {
|
|
h := NewNoteHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_NotionIntegrationHandler_Cov14(t *testing.T) {
|
|
h := NewNotionIntegrationHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_NotificationHandler_Cov14(t *testing.T) {
|
|
h := NewNotificationHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_NotificationSettingHandler_Cov14(t *testing.T) {
|
|
h := NewNotificationSettingHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_NotificationSubscriptionHandler_Cov14(t *testing.T) {
|
|
h := NewNotificationSubscriptionHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_OIDCHandler_Cov14(t *testing.T) {
|
|
h := NewOIDCHandler(nil, nil, nil, nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_PlatformAccountHandler_Cov14(t *testing.T) {
|
|
h := NewPlatformAccountHandler(nil, nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_PlatformAccountUserHandler_Cov14(t *testing.T) {
|
|
h := NewPlatformAccountUserHandler(nil, nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_PlatformAgentBotHandler_Cov14(t *testing.T) {
|
|
h := NewPlatformAgentBotHandler(nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_PlatformAppHandler_Cov14(t *testing.T) {
|
|
h := NewPlatformAppHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_PlatformUserHandler_Cov14(t *testing.T) {
|
|
h := NewPlatformUserHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_PlatformUserSSOHandler_Cov14(t *testing.T) {
|
|
h := NewPlatformUserSSOHandler()
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_PortalHandler_Cov14(t *testing.T) {
|
|
h := NewPortalHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_PortalMemberHandler_Cov14(t *testing.T) {
|
|
h := NewPortalMemberHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_ProfileHandler_Cov14(t *testing.T) {
|
|
h := NewProfileHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_PushSubscriptionHandler_Cov14(t *testing.T) {
|
|
h := NewPushSubscriptionHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_RAGHandler_Cov14(t *testing.T) {
|
|
h := NewRAGHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_ReportingEventHandler_Cov14(t *testing.T) {
|
|
h := NewReportingEventHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_SSEEventHandler_Cov14(t *testing.T) {
|
|
h := NewSSEEventHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_SSEStreamHandler_Cov14(t *testing.T) {
|
|
h := NewSSEStreamHandler(nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_SSOSessionHandler_Cov14(t *testing.T) {
|
|
h := NewSSOSessionHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_SearchHandler_Cov14(t *testing.T) {
|
|
h := NewSearchHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_ShopifyIntegrationHandler_Cov14(t *testing.T) {
|
|
h := NewShopifyIntegrationHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_SlaPolicyHandler_Cov14(t *testing.T) {
|
|
h := NewSlaPolicyHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_SlackIntegrationHandler_Cov14(t *testing.T) {
|
|
h := NewSlackIntegrationHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_SummaryReportHandler_Cov14(t *testing.T) {
|
|
h := NewSummaryReportHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_TeamHandler_Cov14(t *testing.T) {
|
|
h := NewTeamHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_TikTokChannelHandler_Cov14(t *testing.T) {
|
|
h := NewTikTokChannelHandler(nil, nil, nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_TwilioChannelHandler_Cov14(t *testing.T) {
|
|
h := NewTwilioChannelHandler(nil, nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_TwitterChannelHandler_Cov14(t *testing.T) {
|
|
h := NewTwitterChannelHandler(nil, nil, nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_UploadHandler_Cov14(t *testing.T) {
|
|
h := NewUploadHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_WebWidgetHandler_Cov14(t *testing.T) {
|
|
h := NewWebWidgetHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_WebWidgetOfflineHandler_Cov14(t *testing.T) {
|
|
h := NewWebWidgetOfflineHandler(nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_WebWidgetPreChatHandler_Cov14(t *testing.T) {
|
|
h := NewWebWidgetPreChatHandler(nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_WebWidgetThemeHandler_Cov14(t *testing.T) {
|
|
h := NewWebWidgetThemeHandler(nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_WebhookSubscriptionHandler_Cov14(t *testing.T) {
|
|
h := NewWebhookSubscriptionHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_WhatsAppCallHandler_Cov14(t *testing.T) {
|
|
h := NewWhatsAppCallHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_WidgetTestHandler_Cov14(t *testing.T) {
|
|
h := NewWidgetTestHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_WorkingHourHandler_Cov14(t *testing.T) {
|
|
h := NewWorkingHourHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestCtor_YearInReviewHandler_Cov14(t *testing.T) {
|
|
h := NewYearInReviewHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
// ============ With* Builder Method Tests ============
|
|
|
|
func TestWith_CompanyHandler_EventPublisher_Cov14(t *testing.T) {
|
|
h := NewCompanyHandler(nil)
|
|
result := h.WithEventPublisher(nil)
|
|
assert.NotNil(t, result)
|
|
}
|
|
|
|
func TestWith_ContactHandler_EventPublisher_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
result := h.WithEventPublisher(nil)
|
|
assert.NotNil(t, result)
|
|
}
|
|
|
|
func TestWith_ContactHandler_ContactPresence_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
result := h.WithContactPresence(nil)
|
|
assert.NotNil(t, result)
|
|
}
|
|
|
|
func TestWith_NotificationHandler_EventPublisher_Cov14(t *testing.T) {
|
|
h := NewNotificationHandler(nil)
|
|
result := h.WithEventPublisher(nil)
|
|
assert.NotNil(t, result)
|
|
}
|
|
|
|
func TestWith_InboxHandler_AuditService_Cov14(t *testing.T) {
|
|
h := NewInboxHandler(nil)
|
|
result := h.WithAuditService(nil)
|
|
assert.NotNil(t, result)
|
|
}
|
|
|
|
func TestWith_AutomationRuleHandler_AuditService_Cov14(t *testing.T) {
|
|
h := NewAutomationRuleHandler(nil)
|
|
result := h.WithAuditService(nil)
|
|
assert.NotNil(t, result)
|
|
}
|
|
|
|
func TestWith_AgentCapacityHandler_AuditService_Cov14(t *testing.T) {
|
|
h := NewAgentCapacityHandler(nil)
|
|
result := h.WithAuditService(nil)
|
|
assert.NotNil(t, result)
|
|
}
|
|
|
|
func TestWith_CopilotConfigHandler_AuditService_Cov14(t *testing.T) {
|
|
h := NewCopilotConfigHandler(nil, nil)
|
|
result := h.WithAuditService(nil)
|
|
assert.NotNil(t, result)
|
|
}
|
|
|
|
func TestWith_CopilotConfigHandler_ArticleService_Cov14(t *testing.T) {
|
|
h := NewCopilotConfigHandler(nil, nil)
|
|
result := h.WithArticleService(nil)
|
|
assert.NotNil(t, result)
|
|
}
|
|
|
|
func TestWith_CsatSurveyHandler_AuditService_Cov14(t *testing.T) {
|
|
h := NewCsatSurveyHandler(nil)
|
|
result := h.WithAuditService(nil)
|
|
assert.NotNil(t, result)
|
|
}
|
|
|
|
func TestWith_CustomRoleHandler_AuditService_Cov14(t *testing.T) {
|
|
h := NewCustomRoleHandler(nil)
|
|
result := h.WithAuditService(nil)
|
|
assert.NotNil(t, result)
|
|
}
|
|
|
|
func TestWith_SlaPolicyHandler_AuditService_Cov14(t *testing.T) {
|
|
h := NewSlaPolicyHandler(nil)
|
|
result := h.WithAuditService(nil)
|
|
assert.NotNil(t, result)
|
|
}
|
|
|
|
func TestWith_BulkActionHandler_WorkerPool_Cov14(t *testing.T) {
|
|
h := NewBulkActionHandler(nil, nil)
|
|
result := h.WithWorkerPool(nil)
|
|
assert.NotNil(t, result)
|
|
}
|
|
|
|
// ============ Account Handler Method Tests ============
|
|
|
|
func TestAccountHandler_List_Cov14(t *testing.T) {
|
|
h := NewAccountHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/accounts?page=1", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestAccountHandler_Get_Cov14(t *testing.T) {
|
|
h := NewAccountHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/accounts/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestAccountHandler_Create_Cov14(t *testing.T) {
|
|
h := NewAccountHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/accounts", "1", `{"name":"test"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestAccountHandler_Update_Cov14(t *testing.T) {
|
|
h := NewAccountHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/accounts/1", "1", `{"name":"test"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestAccountHandler_UpdateOnboarding_Cov14(t *testing.T) {
|
|
h := NewAccountHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/onboarding", "1", `{"step":1}`)
|
|
safeCall_Cov14(t, func() { h.UpdateOnboarding(c) })
|
|
}
|
|
|
|
func TestAccountHandler_HelpCenterGeneration_Cov14(t *testing.T) {
|
|
h := NewAccountHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/help_center/generation", "1", `{}`)
|
|
safeCall_Cov14(t, func() { h.HelpCenterGeneration(c) })
|
|
}
|
|
|
|
func TestAccountHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewAccountHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/accounts/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestAccountHandler_ListUsers_Cov14(t *testing.T) {
|
|
h := NewAccountHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/users", "1")
|
|
safeCall_Cov14(t, func() { h.ListUsers(c) })
|
|
}
|
|
|
|
func TestAccountHandler_AddUser_Cov14(t *testing.T) {
|
|
h := NewAccountHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/users", "1", `{"user_id":1}`)
|
|
safeCall_Cov14(t, func() { h.AddUser(c) })
|
|
}
|
|
|
|
func TestAccountHandler_RemoveUser_Cov14(t *testing.T) {
|
|
h := NewAccountHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/users/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "user_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.RemoveUser(c) })
|
|
}
|
|
|
|
func TestAccountHandler_GetAll_Cov14(t *testing.T) {
|
|
h := NewAccountHandler(nil)
|
|
c, _ := newCtx_Cov14("GET", "/api/v1/accounts/all")
|
|
safeCall_Cov14(t, func() { h.GetAll(c) })
|
|
}
|
|
|
|
func TestAccountHandler_GetAgents_Cov14(t *testing.T) {
|
|
h := NewAccountHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/agents", "1")
|
|
safeCall_Cov14(t, func() { h.GetAgents(c) })
|
|
}
|
|
|
|
func TestAccountHandler_UpdateSettings_Cov14(t *testing.T) {
|
|
h := NewAccountHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/settings", "1", `{"key":"val"}`)
|
|
safeCall_Cov14(t, func() { h.UpdateSettings(c) })
|
|
}
|
|
|
|
func TestAccountHandler_UpdateActiveAt_Cov14(t *testing.T) {
|
|
h := NewAccountHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/active_at", "1")
|
|
safeCall_Cov14(t, func() { h.UpdateActiveAt(c) })
|
|
}
|
|
|
|
func TestAccountHandler_CacheKeys_Cov14(t *testing.T) {
|
|
h := NewAccountHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/cache_keys", "1")
|
|
safeCall_Cov14(t, func() { h.CacheKeys(c) })
|
|
}
|
|
|
|
// ============ Agent Handler Method Tests ============
|
|
|
|
func TestAgentHandler_List_Cov14(t *testing.T) {
|
|
h := NewAgentHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/agents", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestAgentHandler_Get_Cov14(t *testing.T) {
|
|
h := NewAgentHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/agents/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestAgentHandler_Create_Cov14(t *testing.T) {
|
|
h := NewAgentHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/agents", "1", `{"name":"test","email":"t@t.com"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestAgentHandler_Update_Cov14(t *testing.T) {
|
|
h := NewAgentHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/agents/1", "1", `{"name":"test"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestAgentHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewAgentHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/agents/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestAgentHandler_ResetPassword_Cov14(t *testing.T) {
|
|
h := NewAgentHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/agents/1/reset_password", "1", `{"password":"new"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ResetPassword(c) })
|
|
}
|
|
|
|
func TestAgentHandler_BulkCreate_Cov14(t *testing.T) {
|
|
h := NewAgentHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/agents/bulk_create", "1", `[{"name":"a","email":"a@a.com"}]`)
|
|
safeCall_Cov14(t, func() { h.BulkCreate(c) })
|
|
}
|
|
|
|
// ============ Agent Bot Handler Tests ============
|
|
|
|
func TestAgentBotHandler_Create_Cov14(t *testing.T) {
|
|
h := NewAgentBotHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/agent_bots", "1", `{"name":"bot"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestAgentBotHandler_Get_Cov14(t *testing.T) {
|
|
h := NewAgentBotHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/agent_bots/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestAgentBotHandler_Update_Cov14(t *testing.T) {
|
|
h := NewAgentBotHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/agent_bots/1", "1", `{"name":"bot"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestAgentBotHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewAgentBotHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/agent_bots/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestAgentBotHandler_List_Cov14(t *testing.T) {
|
|
h := NewAgentBotHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/agent_bots", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
// ============ Agent Bot Inbox Handler Tests ============
|
|
|
|
func TestAgentBotInboxHandler_Bind_Cov14(t *testing.T) {
|
|
h := NewAgentBotInboxHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/inboxes/1/agent_bots", "1", `{"agent_bot_id":1}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Bind(c) })
|
|
}
|
|
|
|
func TestAgentBotInboxHandler_Unbind_Cov14(t *testing.T) {
|
|
h := NewAgentBotInboxHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/inboxes/1/agent_bots/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Unbind(c) })
|
|
}
|
|
|
|
func TestAgentBotInboxHandler_UpdateStatus_Cov14(t *testing.T) {
|
|
h := NewAgentBotInboxHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PATCH", "/api/v1/accounts/1/inboxes/1/agent_bots/1", "1", `{"status":"active"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.UpdateStatus(c) })
|
|
}
|
|
|
|
func TestAgentBotInboxHandler_ListByInbox_Cov14(t *testing.T) {
|
|
h := NewAgentBotInboxHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/inboxes/1/agent_bots", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ListByInbox(c) })
|
|
}
|
|
|
|
func TestAgentBotInboxHandler_ListByBot_Cov14(t *testing.T) {
|
|
h := NewAgentBotInboxHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/agent_bots/1/inboxes", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "agent_bot_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ListByBot(c) })
|
|
}
|
|
|
|
// ============ Agent Bulk Handler Tests ============
|
|
|
|
func TestAgentBulkHandler_BulkAssign_Cov14(t *testing.T) {
|
|
h := NewAgentBulkHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/agents/bulk_assign", "1", `{"ids":[1],"agent_id":1}`)
|
|
safeCall_Cov14(t, func() { h.BulkAssign(c) })
|
|
}
|
|
|
|
func TestAgentBulkHandler_BulkUnassign_Cov14(t *testing.T) {
|
|
h := NewAgentBulkHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/agents/bulk_unassign", "1", `{"ids":[1]}`)
|
|
safeCall_Cov14(t, func() { h.BulkUnassign(c) })
|
|
}
|
|
|
|
// ============ Agent Capacity Handler Tests ============
|
|
|
|
func TestAgentCapacityHandler_List_Cov14(t *testing.T) {
|
|
h := NewAgentCapacityHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/agent_capacity", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestAgentCapacityHandler_Create_Cov14(t *testing.T) {
|
|
h := NewAgentCapacityHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/agent_capacity", "1", `{"name":"p"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestAgentCapacityHandler_Get_Cov14(t *testing.T) {
|
|
h := NewAgentCapacityHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/agent_capacity/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestAgentCapacityHandler_Update_Cov14(t *testing.T) {
|
|
h := NewAgentCapacityHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/agent_capacity/1", "1", `{"name":"p"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestAgentCapacityHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewAgentCapacityHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/agent_capacity/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestAgentCapacityHandler_CreateInboxLimit_Cov14(t *testing.T) {
|
|
h := NewAgentCapacityHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/agent_capacity/1/inbox_limits", "1", `{"inbox_id":1}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.CreateInboxLimit(c) })
|
|
}
|
|
|
|
func TestAgentCapacityHandler_UpdateInboxLimit_Cov14(t *testing.T) {
|
|
h := NewAgentCapacityHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/agent_capacity/1/inbox_limits/1", "1", `{"inbox_id":1}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.UpdateInboxLimit(c) })
|
|
}
|
|
|
|
func TestAgentCapacityHandler_DeleteInboxLimit_Cov14(t *testing.T) {
|
|
h := NewAgentCapacityHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/agent_capacity/1/inbox_limits/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DeleteInboxLimit(c) })
|
|
}
|
|
|
|
func TestAgentCapacityHandler_ListUsers_Cov14(t *testing.T) {
|
|
h := NewAgentCapacityHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/agent_capacity/1/users", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ListUsers(c) })
|
|
}
|
|
|
|
func TestAgentCapacityHandler_CreateUser_Cov14(t *testing.T) {
|
|
h := NewAgentCapacityHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/agent_capacity/1/users", "1", `{"user_id":1}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.CreateUser(c) })
|
|
}
|
|
|
|
func TestAgentCapacityHandler_DeleteUser_Cov14(t *testing.T) {
|
|
h := NewAgentCapacityHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/agent_capacity/1/users/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "user_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DeleteUser(c) })
|
|
}
|
|
|
|
// ============ Analytics Handler Tests ============
|
|
|
|
func TestAnalyticsHandler_Index_Cov14(t *testing.T) {
|
|
h := NewAnalyticsHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/analytics", "1")
|
|
safeCall_Cov14(t, func() { h.Index(c) })
|
|
}
|
|
|
|
func TestAnalyticsHandler_Drilldown_Cov14(t *testing.T) {
|
|
h := NewAnalyticsHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/analytics/drilldown", "1")
|
|
safeCall_Cov14(t, func() { h.Drilldown(c) })
|
|
}
|
|
|
|
func TestAnalyticsHandler_Summary_Cov14(t *testing.T) {
|
|
h := NewAnalyticsHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/analytics/summary", "1")
|
|
safeCall_Cov14(t, func() { h.Summary(c) })
|
|
}
|
|
|
|
func TestAnalyticsHandler_AgentMetrics_Cov14(t *testing.T) {
|
|
h := NewAnalyticsHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/analytics/agent_metrics", "1")
|
|
safeCall_Cov14(t, func() { h.AgentMetrics(c) })
|
|
}
|
|
|
|
func TestAnalyticsHandler_InboxMetrics_Cov14(t *testing.T) {
|
|
h := NewAnalyticsHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/analytics/inbox_metrics", "1")
|
|
safeCall_Cov14(t, func() { h.InboxMetrics(c) })
|
|
}
|
|
|
|
func TestAnalyticsHandler_LabelMetrics_Cov14(t *testing.T) {
|
|
h := NewAnalyticsHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/analytics/label_metrics", "1")
|
|
safeCall_Cov14(t, func() { h.LabelMetrics(c) })
|
|
}
|
|
|
|
func TestAnalyticsHandler_TeamMetrics_Cov14(t *testing.T) {
|
|
h := NewAnalyticsHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/analytics/team_metrics", "1")
|
|
safeCall_Cov14(t, func() { h.TeamMetrics(c) })
|
|
}
|
|
|
|
func TestAnalyticsHandler_ConversationTraffic_Cov14(t *testing.T) {
|
|
h := NewAnalyticsHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/analytics/conversation_traffic", "1")
|
|
safeCall_Cov14(t, func() { h.ConversationTraffic(c) })
|
|
}
|
|
|
|
func TestAnalyticsHandler_BotSummary_Cov14(t *testing.T) {
|
|
h := NewAnalyticsHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/analytics/bot_summary", "1")
|
|
safeCall_Cov14(t, func() { h.BotSummary(c) })
|
|
}
|
|
|
|
func TestAnalyticsHandler_Conversations_Cov14(t *testing.T) {
|
|
h := NewAnalyticsHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/analytics/conversations", "1")
|
|
safeCall_Cov14(t, func() { h.Conversations(c) })
|
|
}
|
|
|
|
func TestAnalyticsHandler_ConversationsSummary_Cov14(t *testing.T) {
|
|
h := NewAnalyticsHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/analytics/conversations_summary", "1")
|
|
safeCall_Cov14(t, func() { h.ConversationsSummary(c) })
|
|
}
|
|
|
|
func TestAnalyticsHandler_BotMetrics_Cov14(t *testing.T) {
|
|
h := NewAnalyticsHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/analytics/bot_metrics", "1")
|
|
safeCall_Cov14(t, func() { h.BotMetrics(c) })
|
|
}
|
|
|
|
func TestAnalyticsHandler_InboxLabelMatrix_Cov14(t *testing.T) {
|
|
h := NewAnalyticsHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/analytics/inbox_label_matrix", "1")
|
|
safeCall_Cov14(t, func() { h.InboxLabelMatrix(c) })
|
|
}
|
|
|
|
func TestAnalyticsHandler_FirstResponseTimeDistribution_Cov14(t *testing.T) {
|
|
h := NewAnalyticsHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/analytics/first_response_time_distribution", "1")
|
|
safeCall_Cov14(t, func() { h.FirstResponseTimeDistribution(c) })
|
|
}
|
|
|
|
func TestAnalyticsHandler_OutgoingMessagesCount_Cov14(t *testing.T) {
|
|
h := NewAnalyticsHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/analytics/outgoing_messages_count", "1")
|
|
safeCall_Cov14(t, func() { h.OutgoingMessagesCount(c) })
|
|
}
|
|
|
|
// ============ Article Handler Tests ============
|
|
|
|
func TestArticleHandler_List_Cov14(t *testing.T) {
|
|
h := NewArticleHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/articles", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestArticleHandler_Get_Cov14(t *testing.T) {
|
|
h := NewArticleHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/articles/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestArticleHandler_Create_Cov14(t *testing.T) {
|
|
h := NewArticleHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/articles", "1", `{"title":"t","content":"c"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestArticleHandler_Update_Cov14(t *testing.T) {
|
|
h := NewArticleHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/articles/1", "1", `{"title":"t"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestArticleHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewArticleHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/articles/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
// ============ Assignment Policy Handler Tests ============
|
|
|
|
func TestAssignmentPolicyHandler_ListAccountPolicies_Cov14(t *testing.T) {
|
|
h := NewAssignmentPolicyHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/assignment_policies", "1")
|
|
safeCall_Cov14(t, func() { h.ListAccountPolicies(c) })
|
|
}
|
|
|
|
func TestAssignmentPolicyHandler_GetAccountPolicy_Cov14(t *testing.T) {
|
|
h := NewAssignmentPolicyHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/assignment_policies/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.GetAccountPolicy(c) })
|
|
}
|
|
|
|
func TestAssignmentPolicyHandler_CreateAccountPolicy_Cov14(t *testing.T) {
|
|
h := NewAssignmentPolicyHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/assignment_policies", "1", `{"name":"p"}`)
|
|
safeCall_Cov14(t, func() { h.CreateAccountPolicy(c) })
|
|
}
|
|
|
|
func TestAssignmentPolicyHandler_UpdateAccountPolicy_Cov14(t *testing.T) {
|
|
h := NewAssignmentPolicyHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/assignment_policies/1", "1", `{"name":"p"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.UpdateAccountPolicy(c) })
|
|
}
|
|
|
|
func TestAssignmentPolicyHandler_DeleteAccountPolicy_Cov14(t *testing.T) {
|
|
h := NewAssignmentPolicyHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/assignment_policies/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DeleteAccountPolicy(c) })
|
|
}
|
|
|
|
func TestAssignmentPolicyHandler_GetInboxPolicy_Cov14(t *testing.T) {
|
|
h := NewAssignmentPolicyHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/inboxes/1/assignment_policy", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.GetInboxPolicy(c) })
|
|
}
|
|
|
|
func TestAssignmentPolicyHandler_ListPolicyInboxes_Cov14(t *testing.T) {
|
|
h := NewAssignmentPolicyHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/assignment_policies/1/inboxes", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ListPolicyInboxes(c) })
|
|
}
|
|
|
|
func TestAssignmentPolicyHandler_AddPolicyInbox_Cov14(t *testing.T) {
|
|
h := NewAssignmentPolicyHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/assignment_policies/1/inboxes", "1", `{"inbox_id":1}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.AddPolicyInbox(c) })
|
|
}
|
|
|
|
func TestAssignmentPolicyHandler_RemovePolicyInbox_Cov14(t *testing.T) {
|
|
h := NewAssignmentPolicyHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/assignment_policies/1/inboxes/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.RemovePolicyInbox(c) })
|
|
}
|
|
|
|
func TestAssignmentPolicyHandler_CreateInboxPolicy_Cov14(t *testing.T) {
|
|
h := NewAssignmentPolicyHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/inboxes/1/assignment_policy", "1", `{"policy_id":1}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.CreateInboxPolicy(c) })
|
|
}
|
|
|
|
func TestAssignmentPolicyHandler_UpdateInboxPolicy_Cov14(t *testing.T) {
|
|
h := NewAssignmentPolicyHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/inboxes/1/assignment_policy", "1", `{"policy_id":1}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.UpdateInboxPolicy(c) })
|
|
}
|
|
|
|
func TestAssignmentPolicyHandler_DeleteInboxPolicy_Cov14(t *testing.T) {
|
|
h := NewAssignmentPolicyHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/inboxes/1/assignment_policy", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DeleteInboxPolicy(c) })
|
|
}
|
|
|
|
func TestAssignmentPolicyHandler_DeleteCurrentInboxPolicy_Cov14(t *testing.T) {
|
|
h := NewAssignmentPolicyHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/inboxes/1/assignment_policy/current", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DeleteCurrentInboxPolicy(c) })
|
|
}
|
|
|
|
// ============ Assignment Policy V2 Handler Tests ============
|
|
|
|
func TestAssignmentPolicyV2Handler_Create_Cov14(t *testing.T) {
|
|
h := NewAssignmentPolicyV2Handler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/assignment_policies_v2", "1", `{"name":"p"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestAssignmentPolicyV2Handler_Get_Cov14(t *testing.T) {
|
|
h := NewAssignmentPolicyV2Handler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/assignment_policies_v2/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestAssignmentPolicyV2Handler_List_Cov14(t *testing.T) {
|
|
h := NewAssignmentPolicyV2Handler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/assignment_policies_v2", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestAssignmentPolicyV2Handler_Update_Cov14(t *testing.T) {
|
|
h := NewAssignmentPolicyV2Handler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/assignment_policies_v2/1", "1", `{"name":"p"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestAssignmentPolicyV2Handler_Delete_Cov14(t *testing.T) {
|
|
h := NewAssignmentPolicyV2Handler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/assignment_policies_v2/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestAssignmentPolicyV2Handler_ListInboxes_Cov14(t *testing.T) {
|
|
h := NewAssignmentPolicyV2Handler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/assignment_policies_v2/1/inboxes", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ListInboxes(c) })
|
|
}
|
|
|
|
func TestAssignmentPolicyV2Handler_AddInbox_Cov14(t *testing.T) {
|
|
h := NewAssignmentPolicyV2Handler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/assignment_policies_v2/1/inboxes", "1", `{"inbox_id":1}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.AddInbox(c) })
|
|
}
|
|
|
|
func TestAssignmentPolicyV2Handler_RemoveInbox_Cov14(t *testing.T) {
|
|
h := NewAssignmentPolicyV2Handler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/assignment_policies_v2/1/inboxes/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.RemoveInbox(c) })
|
|
}
|
|
|
|
func TestAssignmentPolicyV2Handler_GetInboxPolicy_Cov14(t *testing.T) {
|
|
h := NewAssignmentPolicyV2Handler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/inboxes/1/assignment_policy_v2", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.GetInboxPolicy(c) })
|
|
}
|
|
|
|
func TestAssignmentPolicyV2Handler_SetInboxPolicy_Cov14(t *testing.T) {
|
|
h := NewAssignmentPolicyV2Handler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/inboxes/1/assignment_policy_v2", "1", `{"policy_id":1}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.SetInboxPolicy(c) })
|
|
}
|
|
|
|
func TestAssignmentPolicyV2Handler_DeleteInboxPolicy_Cov14(t *testing.T) {
|
|
h := NewAssignmentPolicyV2Handler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/inboxes/1/assignment_policy_v2", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DeleteInboxPolicy(c) })
|
|
}
|
|
|
|
// ============ Audit Handler Tests ============
|
|
|
|
func TestAuditHandler_List_Cov14(t *testing.T) {
|
|
h := NewAuditHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/audits", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestAuditHandler_Get_Cov14(t *testing.T) {
|
|
h := NewAuditHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/audits/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
// ============ Auth Handler Tests ============
|
|
|
|
func TestAuthHandler_Login_Cov14(t *testing.T) {
|
|
h := NewAuthHandler(nil)
|
|
c, _ := newCtxBody_Cov14("POST", "/auth/sign_in", `{"email":"t@t.com","password":"p"}`)
|
|
safeCall_Cov14(t, func() { h.Login(c) })
|
|
}
|
|
|
|
func TestAuthHandler_ChatwootSignIn_Cov14(t *testing.T) {
|
|
h := NewAuthHandler(nil)
|
|
c, _ := newCtxBody_Cov14("POST", "/chatwoot/sign_in", `{"email":"t@t.com","password":"p"}`)
|
|
safeCall_Cov14(t, func() { h.ChatwootSignIn(c) })
|
|
}
|
|
|
|
func TestAuthHandler_ChatwootValidateToken_Cov14(t *testing.T) {
|
|
h := NewAuthHandler(nil)
|
|
c, _ := newCtxBody_Cov14("GET", "/chatwoot/validate_token", `{}`)
|
|
safeCall_Cov14(t, func() { h.ChatwootValidateToken(c) })
|
|
}
|
|
|
|
func TestAuthHandler_ChatwootSignOut_Cov14(t *testing.T) {
|
|
h := NewAuthHandler(nil)
|
|
c, _ := newCtxBody_Cov14("DELETE", "/chatwoot/sign_out", `{}`)
|
|
safeCall_Cov14(t, func() { h.ChatwootSignOut(c) })
|
|
}
|
|
|
|
func TestAuthHandler_Refresh_Cov14(t *testing.T) {
|
|
h := NewAuthHandler(nil)
|
|
c, _ := newCtxBody_Cov14("POST", "/auth/refresh", `{"refresh_token":"t"}`)
|
|
safeCall_Cov14(t, func() { h.Refresh(c) })
|
|
}
|
|
|
|
func TestAuthHandler_Logout_Cov14(t *testing.T) {
|
|
h := NewAuthHandler(nil)
|
|
c, _ := newCtxBody_Cov14("DELETE", "/auth/sign_out", `{}`)
|
|
safeCall_Cov14(t, func() { h.Logout(c) })
|
|
}
|
|
|
|
func TestAuthHandler_SwitchAccount_Cov14(t *testing.T) {
|
|
h := NewAuthHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/switch", "1", `{}`)
|
|
safeCall_Cov14(t, func() { h.SwitchAccount(c) })
|
|
}
|
|
|
|
func TestAuthHandler_ResetPassword_Cov14(t *testing.T) {
|
|
h := NewAuthHandler(nil)
|
|
c, _ := newCtxBody_Cov14("POST", "/auth/password", `{"email":"t@t.com"}`)
|
|
safeCall_Cov14(t, func() { h.ResetPassword(c) })
|
|
}
|
|
|
|
func TestAuthHandler_ConfirmResetPassword_Cov14(t *testing.T) {
|
|
h := NewAuthHandler(nil)
|
|
c, _ := newCtxBody_Cov14("PUT", "/auth/password", `{"token":"t","password":"p"}`)
|
|
safeCall_Cov14(t, func() { h.ConfirmResetPassword(c) })
|
|
}
|
|
|
|
func TestAuthHandler_ConfirmEmail_Cov14(t *testing.T) {
|
|
h := NewAuthHandler(nil)
|
|
c, _ := newCtx_Cov14("GET", "/auth/confirmation?confirmation_token=t")
|
|
safeCall_Cov14(t, func() { h.ConfirmEmail(c) })
|
|
}
|
|
|
|
func TestAuthHandler_ChatwootConfirmEmail_Cov14(t *testing.T) {
|
|
h := NewAuthHandler(nil)
|
|
c, _ := newCtx_Cov14("GET", "/chatwoot/confirmation?confirmation_token=t")
|
|
safeCall_Cov14(t, func() { h.ChatwootConfirmEmail(c) })
|
|
}
|
|
|
|
// ============ Banner Handler Tests ============
|
|
|
|
func TestBannerHandler_List_Cov14(t *testing.T) {
|
|
h := NewBannerHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/banners", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestBannerHandler_Get_Cov14(t *testing.T) {
|
|
h := NewBannerHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/banners/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestBannerHandler_Create_Cov14(t *testing.T) {
|
|
h := NewBannerHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/banners", "1", `{"title":"t"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestBannerHandler_Update_Cov14(t *testing.T) {
|
|
h := NewBannerHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/banners/1", "1", `{"title":"t"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestBannerHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewBannerHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/banners/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestBannerHandler_ListActive_Cov14(t *testing.T) {
|
|
h := NewBannerHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/banners/active", "1")
|
|
safeCall_Cov14(t, func() { h.ListActive(c) })
|
|
}
|
|
|
|
// ============ Bot Rule Handler Tests ============
|
|
|
|
func TestBotRuleHandler_List_Cov14(t *testing.T) {
|
|
h := NewBotRuleHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/bot_rules", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestBotRuleHandler_ListByBot_Cov14(t *testing.T) {
|
|
h := NewBotRuleHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/agent_bots/1/bot_rules", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "agent_bot_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ListByBot(c) })
|
|
}
|
|
|
|
func TestBotRuleHandler_Get_Cov14(t *testing.T) {
|
|
h := NewBotRuleHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/bot_rules/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestBotRuleHandler_Create_Cov14(t *testing.T) {
|
|
h := NewBotRuleHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/bot_rules", "1", `{"name":"r"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestBotRuleHandler_Update_Cov14(t *testing.T) {
|
|
h := NewBotRuleHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/bot_rules/1", "1", `{"name":"r"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestBotRuleHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewBotRuleHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/bot_rules/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestBotRuleHandler_ToggleStatus_Cov14(t *testing.T) {
|
|
h := NewBotRuleHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/bot_rules/1/toggle_status", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ToggleStatus(c) })
|
|
}
|
|
|
|
func TestBotRuleHandler_Clone_Cov14(t *testing.T) {
|
|
h := NewBotRuleHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/bot_rules/1/clone", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Clone(c) })
|
|
}
|
|
|
|
// ============ Bot Trigger Config Handler Tests ============
|
|
|
|
func TestBotTriggerConfigHandler_Update_Cov14(t *testing.T) {
|
|
h := NewBotTriggerConfigHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/bot_trigger_configs/1", "1", `{"enabled":true}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestBotTriggerConfigHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewBotTriggerConfigHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/bot_trigger_configs/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestBotTriggerConfigHandler_ToggleActive_Cov14(t *testing.T) {
|
|
h := NewBotTriggerConfigHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/bot_trigger_configs/1/toggle_active", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ToggleActive(c) })
|
|
}
|
|
|
|
// ============ Bulk Action Handler Tests ============
|
|
|
|
func TestBulkActionHandler_Create_Cov14(t *testing.T) {
|
|
h := NewBulkActionHandler(nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/bulk_actions", "1", `{"type":"conversation","action":"assign"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
// ============ Campaign Handler Tests ============
|
|
|
|
func TestCampaignHandler_List_Cov14(t *testing.T) {
|
|
h := NewCampaignHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/campaigns", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestCampaignHandler_Get_Cov14(t *testing.T) {
|
|
h := NewCampaignHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/campaigns/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestCampaignHandler_Create_Cov14(t *testing.T) {
|
|
h := NewCampaignHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/campaigns", "1", `{"title":"c"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestCampaignHandler_Update_Cov14(t *testing.T) {
|
|
h := NewCampaignHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/campaigns/1", "1", `{"title":"c"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestCampaignHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewCampaignHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/campaigns/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestCampaignHandler_Start_Cov14(t *testing.T) {
|
|
h := NewCampaignHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/campaigns/1/start", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Start(c) })
|
|
}
|
|
|
|
func TestCampaignHandler_Stop_Cov14(t *testing.T) {
|
|
h := NewCampaignHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/campaigns/1/stop", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Stop(c) })
|
|
}
|
|
|
|
// ============ Canned Response Handler Tests ============
|
|
|
|
func TestCannedResponseHandler_Create_Cov14(t *testing.T) {
|
|
h := NewCannedResponseHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/canned_responses", "1", `{"content":"c"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestCannedResponseHandler_Get_Cov14(t *testing.T) {
|
|
h := NewCannedResponseHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/canned_responses/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestCannedResponseHandler_Update_Cov14(t *testing.T) {
|
|
h := NewCannedResponseHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/canned_responses/1", "1", `{"content":"c"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestCannedResponseHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewCannedResponseHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/canned_responses/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestCannedResponseHandler_List_Cov14(t *testing.T) {
|
|
h := NewCannedResponseHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/canned_responses", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestCannedResponseHandler_Search_Cov14(t *testing.T) {
|
|
h := NewCannedResponseHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/canned_responses/search?query=t", "1")
|
|
safeCall_Cov14(t, func() { h.Search(c) })
|
|
}
|
|
|
|
// ============ Captain Assistant Handler Tests ============
|
|
|
|
func TestCaptainAssistantHandler_Create_Cov14(t *testing.T) {
|
|
h := NewCaptainAssistantHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/captain_assistants", "1", `{"name":"a"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestCaptainAssistantHandler_Get_Cov14(t *testing.T) {
|
|
h := NewCaptainAssistantHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/captain_assistants/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestCaptainAssistantHandler_Update_Cov14(t *testing.T) {
|
|
h := NewCaptainAssistantHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/captain_assistants/1", "1", `{"name":"a"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestCaptainAssistantHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewCaptainAssistantHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/captain_assistants/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestCaptainAssistantHandler_List_Cov14(t *testing.T) {
|
|
h := NewCaptainAssistantHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/captain_assistants", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestCaptainAssistantHandler_Stats_Cov14(t *testing.T) {
|
|
h := NewCaptainAssistantHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/captain_assistants/1/stats", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Stats(c) })
|
|
}
|
|
|
|
func TestCaptainAssistantHandler_Summary_Cov14(t *testing.T) {
|
|
h := NewCaptainAssistantHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/captain_assistants/1/summary", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Summary(c) })
|
|
}
|
|
|
|
func TestCaptainAssistantHandler_Drilldown_Cov14(t *testing.T) {
|
|
h := NewCaptainAssistantHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/captain_assistants/1/drilldown", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Drilldown(c) })
|
|
}
|
|
|
|
func TestCaptainAssistantHandler_CreateMessageReport_Cov14(t *testing.T) {
|
|
h := NewCaptainAssistantHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/captain_assistants/1/message_reports", "1", `{"message_id":1}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.CreateMessageReport(c) })
|
|
}
|
|
|
|
func TestCaptainAssistantHandler_GetConfig_Cov14(t *testing.T) {
|
|
h := NewCaptainAssistantHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/captain_assistants/1/config", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.GetConfig(c) })
|
|
}
|
|
|
|
func TestCaptainAssistantHandler_SetConfig_Cov14(t *testing.T) {
|
|
h := NewCaptainAssistantHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/captain_assistants/1/config", "1", `{"enabled":true}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.SetConfig(c) })
|
|
}
|
|
|
|
func TestCaptainAssistantHandler_AssociateInbox_Cov14(t *testing.T) {
|
|
h := NewCaptainAssistantHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/captain_assistants/1/inboxes", "1", `{"inbox_id":1}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.AssociateInbox(c) })
|
|
}
|
|
|
|
func TestCaptainAssistantHandler_DissociateInbox_Cov14(t *testing.T) {
|
|
h := NewCaptainAssistantHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/captain_assistants/1/inboxes/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DissociateInbox(c) })
|
|
}
|
|
|
|
func TestCaptainAssistantHandler_ListInboxes_Cov14(t *testing.T) {
|
|
h := NewCaptainAssistantHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/captain_assistants/1/inboxes", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ListInboxes(c) })
|
|
}
|
|
|
|
func TestCaptainAssistantHandler_Tools_Cov14(t *testing.T) {
|
|
h := NewCaptainAssistantHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/captain_assistants/1/tools", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Tools(c) })
|
|
}
|
|
|
|
func TestCaptainAssistantHandler_GenerateResponse_Cov14(t *testing.T) {
|
|
h := NewCaptainAssistantHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/captain_assistants/1/generate_response", "1", `{"message":"hi"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.GenerateResponse(c) })
|
|
}
|
|
|
|
// ============ Captain Assistant Response Handler Tests ============
|
|
|
|
func TestCaptainAssistantResponseHandler_ProcessResponse_Cov14(t *testing.T) {
|
|
h := NewCaptainAssistantResponseHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/captain_responses/process", "1", `{"message_id":1}`)
|
|
safeCall_Cov14(t, func() { h.ProcessResponse(c) })
|
|
}
|
|
|
|
func TestCaptainAssistantResponseHandler_List_Cov14(t *testing.T) {
|
|
h := NewCaptainAssistantResponseHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/captain_responses", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestCaptainAssistantResponseHandler_Get_Cov14(t *testing.T) {
|
|
h := NewCaptainAssistantResponseHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/captain_responses/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestCaptainAssistantResponseHandler_Update_Cov14(t *testing.T) {
|
|
h := NewCaptainAssistantResponseHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/captain_responses/1", "1", `{"status":"approved"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestCaptainAssistantResponseHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewCaptainAssistantResponseHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/captain_responses/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestCaptainAssistantResponseHandler_Create_Cov14(t *testing.T) {
|
|
h := NewCaptainAssistantResponseHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/captain_responses", "1", `{"content":"r"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
// ============ Captain Conversation Handler Tests ============
|
|
|
|
func TestCaptainConversationHandler_BuildResponse_Cov14(t *testing.T) {
|
|
h := NewCaptainConversationHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/captain_conversations/1/build_response", "1", `{"message":"hi"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.BuildResponse(c) })
|
|
}
|
|
|
|
// ============ Captain Custom Tool Handler Tests ============
|
|
|
|
func TestCaptainCustomToolHandler_Create_Cov14(t *testing.T) {
|
|
h := NewCaptainCustomToolHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/captain_custom_tools", "1", `{"name":"t"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestCaptainCustomToolHandler_Get_Cov14(t *testing.T) {
|
|
h := NewCaptainCustomToolHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/captain_custom_tools/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestCaptainCustomToolHandler_Update_Cov14(t *testing.T) {
|
|
h := NewCaptainCustomToolHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/captain_custom_tools/1", "1", `{"name":"t"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestCaptainCustomToolHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewCaptainCustomToolHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/captain_custom_tools/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestCaptainCustomToolHandler_List_Cov14(t *testing.T) {
|
|
h := NewCaptainCustomToolHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/captain_custom_tools", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestCaptainCustomToolHandler_ExecuteTool_Cov14(t *testing.T) {
|
|
h := NewCaptainCustomToolHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/captain_custom_tools/1/execute", "1", `{"input":"test"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ExecuteTool(c) })
|
|
}
|
|
|
|
func TestCaptainCustomToolHandler_TestTool_Cov14(t *testing.T) {
|
|
h := NewCaptainCustomToolHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/captain_custom_tools/1/test", "1", `{"input":"test"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.TestTool(c) })
|
|
}
|
|
|
|
// ============ Captain Document Handler Tests ============
|
|
|
|
func TestCaptainDocumentHandler_Create_Cov14(t *testing.T) {
|
|
h := NewCaptainDocumentHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/captain_documents", "1", `{"title":"d"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestCaptainDocumentHandler_Get_Cov14(t *testing.T) {
|
|
h := NewCaptainDocumentHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/captain_documents/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestCaptainDocumentHandler_Update_Cov14(t *testing.T) {
|
|
h := NewCaptainDocumentHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/captain_documents/1", "1", `{"title":"d"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestCaptainDocumentHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewCaptainDocumentHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/captain_documents/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestCaptainDocumentHandler_List_Cov14(t *testing.T) {
|
|
h := NewCaptainDocumentHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/captain_documents", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestCaptainDocumentHandler_ProcessDocument_Cov14(t *testing.T) {
|
|
h := NewCaptainDocumentHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/captain_documents/1/process", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ProcessDocument(c) })
|
|
}
|
|
|
|
func TestCaptainDocumentHandler_SyncDocument_Cov14(t *testing.T) {
|
|
h := NewCaptainDocumentHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/captain_documents/1/sync", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.SyncDocument(c) })
|
|
}
|
|
|
|
// ============ Captain Preference Handler Tests ============
|
|
|
|
func TestCaptainPreferenceHandler_Create_Cov14(t *testing.T) {
|
|
h := NewCaptainPreferenceHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/captain_preferences", "1", `{"key":"val"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestCaptainPreferenceHandler_Get_Cov14(t *testing.T) {
|
|
h := NewCaptainPreferenceHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/captain_preferences", "1")
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestCaptainPreferenceHandler_Update_Cov14(t *testing.T) {
|
|
h := NewCaptainPreferenceHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/captain_preferences", "1", `{"key":"val"}`)
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestCaptainPreferenceHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewCaptainPreferenceHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/captain_preferences", "1")
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
// ============ Captain Scenario Handler Tests ============
|
|
|
|
func TestCaptainScenarioHandler_Create_Cov14(t *testing.T) {
|
|
h := NewCaptainScenarioHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/captain_scenarios", "1", `{"name":"s"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestCaptainScenarioHandler_Get_Cov14(t *testing.T) {
|
|
h := NewCaptainScenarioHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/captain_scenarios/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestCaptainScenarioHandler_Update_Cov14(t *testing.T) {
|
|
h := NewCaptainScenarioHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/captain_scenarios/1", "1", `{"name":"s"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestCaptainScenarioHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewCaptainScenarioHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/captain_scenarios/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestCaptainScenarioHandler_List_Cov14(t *testing.T) {
|
|
h := NewCaptainScenarioHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/captain_scenarios", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
// ============ Captain Task Extended Handler Tests ============
|
|
|
|
func TestCaptainTaskExtendedHandler_LabelSuggestion_Cov14(t *testing.T) {
|
|
h := NewCaptainTaskExtendedHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/captain_tasks/label_suggestion", "1", `{"conversation_id":1}`)
|
|
safeCall_Cov14(t, func() { h.LabelSuggestion(c) })
|
|
}
|
|
|
|
func TestCaptainTaskExtendedHandler_FollowUp_Cov14(t *testing.T) {
|
|
h := NewCaptainTaskExtendedHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/captain_tasks/follow_up", "1", `{"conversation_id":1}`)
|
|
safeCall_Cov14(t, func() { h.FollowUp(c) })
|
|
}
|
|
|
|
// ============ Captain Task Handler Tests ============
|
|
|
|
func TestCaptainTaskHandler_ReplySuggestion_Cov14(t *testing.T) {
|
|
h := NewCaptainTaskHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/captain_tasks/reply_suggestion", "1", `{"conversation_id":1}`)
|
|
safeCall_Cov14(t, func() { h.ReplySuggestion(c) })
|
|
}
|
|
|
|
func TestCaptainTaskHandler_Summarize_Cov14(t *testing.T) {
|
|
h := NewCaptainTaskHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/captain_tasks/summarize", "1", `{"conversation_id":1}`)
|
|
safeCall_Cov14(t, func() { h.Summarize(c) })
|
|
}
|
|
|
|
func TestCaptainTaskHandler_Rewrite_Cov14(t *testing.T) {
|
|
h := NewCaptainTaskHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/captain_tasks/rewrite", "1", `{"conversation_id":1,"message":"hi"}`)
|
|
safeCall_Cov14(t, func() { h.Rewrite(c) })
|
|
}
|
|
|
|
func TestCaptainTaskHandler_StreamReplySuggestion_Cov14(t *testing.T) {
|
|
h := NewCaptainTaskHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/captain_tasks/stream_reply_suggestion", "1", `{"conversation_id":1}`)
|
|
safeCall_Cov14(t, func() { h.StreamReplySuggestion(c) })
|
|
}
|
|
|
|
func TestCaptainTaskHandler_StreamSummarize_Cov14(t *testing.T) {
|
|
h := NewCaptainTaskHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/captain_tasks/stream_summarize", "1", `{"conversation_id":1}`)
|
|
safeCall_Cov14(t, func() { h.StreamSummarize(c) })
|
|
}
|
|
|
|
func TestCaptainTaskHandler_StreamRewrite_Cov14(t *testing.T) {
|
|
h := NewCaptainTaskHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/captain_tasks/stream_rewrite", "1", `{"conversation_id":1,"message":"hi"}`)
|
|
safeCall_Cov14(t, func() { h.StreamRewrite(c) })
|
|
}
|
|
|
|
// ============ Category Handler Tests ============
|
|
|
|
func TestCategoryHandler_PublicList_Cov14(t *testing.T) {
|
|
h := NewCategoryHandler(nil)
|
|
c, _ := newCtx_Cov14("GET", "/api/v1/portals/1/categories")
|
|
c.Params = append(c.Params, gin.Param{Key: "portal_slug", Value: "test"})
|
|
safeCall_Cov14(t, func() { h.PublicList(c) })
|
|
}
|
|
|
|
func TestCategoryHandler_PublicGet_Cov14(t *testing.T) {
|
|
h := NewCategoryHandler(nil)
|
|
c, _ := newCtx_Cov14("GET", "/api/v1/portals/1/categories/1")
|
|
c.Params = append(c.Params, gin.Param{Key: "portal_slug", Value: "test"})
|
|
c.Params = append(c.Params, gin.Param{Key: "slug", Value: "test"})
|
|
safeCall_Cov14(t, func() { h.PublicGet(c) })
|
|
}
|
|
|
|
func TestCategoryHandler_Create_Cov14(t *testing.T) {
|
|
h := NewCategoryHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/portals/1/categories", "1", `{"name":"c"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "portal_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestCategoryHandler_Get_Cov14(t *testing.T) {
|
|
h := NewCategoryHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/portals/1/categories/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "portal_id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestCategoryHandler_Update_Cov14(t *testing.T) {
|
|
h := NewCategoryHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/portals/1/categories/1", "1", `{"name":"c"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "portal_id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestCategoryHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewCategoryHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/portals/1/categories/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "portal_id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestCategoryHandler_List_Cov14(t *testing.T) {
|
|
h := NewCategoryHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/portals/1/categories", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "portal_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestCategoryHandler_Reorder_Cov14(t *testing.T) {
|
|
h := NewCategoryHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/portals/1/categories/reorder", "1", `[{"id":1,"position":0}]`)
|
|
c.Params = append(c.Params, gin.Param{Key: "portal_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Reorder(c) })
|
|
}
|
|
|
|
// ============ Company Handler Tests ============
|
|
|
|
func TestCompanyHandler_List_Cov14(t *testing.T) {
|
|
h := NewCompanyHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/companies", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestCompanyHandler_Search_Cov14(t *testing.T) {
|
|
h := NewCompanyHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/companies/search?q=test", "1")
|
|
safeCall_Cov14(t, func() { h.Search(c) })
|
|
}
|
|
|
|
func TestCompanyHandler_Get_Cov14(t *testing.T) {
|
|
h := NewCompanyHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/companies/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestCompanyHandler_Create_Cov14(t *testing.T) {
|
|
h := NewCompanyHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/companies", "1", `{"name":"c"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestCompanyHandler_Update_Cov14(t *testing.T) {
|
|
h := NewCompanyHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/companies/1", "1", `{"name":"c"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestCompanyHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewCompanyHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/companies/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestCompanyHandler_DestroyCustomAttributes_Cov14(t *testing.T) {
|
|
h := NewCompanyHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/companies/1/custom_attributes", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DestroyCustomAttributes(c) })
|
|
}
|
|
|
|
func TestCompanyHandler_DeleteAvatar_Cov14(t *testing.T) {
|
|
h := NewCompanyHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/companies/1/avatar", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DeleteAvatar(c) })
|
|
}
|
|
|
|
func TestCompanyHandler_ListContacts_Cov14(t *testing.T) {
|
|
h := NewCompanyHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/companies/1/contacts", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ListContacts(c) })
|
|
}
|
|
|
|
func TestCompanyHandler_ListConversations_Cov14(t *testing.T) {
|
|
h := NewCompanyHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/companies/1/conversations", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ListConversations(c) })
|
|
}
|
|
|
|
func TestCompanyHandler_SearchContacts_Cov14(t *testing.T) {
|
|
h := NewCompanyHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/companies/1/contacts/search?q=t", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.SearchContacts(c) })
|
|
}
|
|
|
|
func TestCompanyHandler_ListNotes_Cov14(t *testing.T) {
|
|
h := NewCompanyHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/companies/1/notes", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ListNotes(c) })
|
|
}
|
|
|
|
func TestCompanyHandler_CreateNote_Cov14(t *testing.T) {
|
|
h := NewCompanyHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/companies/1/notes", "1", `{"content":"n"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.CreateNote(c) })
|
|
}
|
|
|
|
func TestCompanyHandler_DeleteNote_Cov14(t *testing.T) {
|
|
h := NewCompanyHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/companies/1/notes/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "note_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DeleteNote(c) })
|
|
}
|
|
|
|
func TestCompanyHandler_AddContact_Cov14(t *testing.T) {
|
|
h := NewCompanyHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/companies/1/contacts", "1", `{"contact_id":1}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.AddContact(c) })
|
|
}
|
|
|
|
func TestCompanyHandler_RemoveContact_Cov14(t *testing.T) {
|
|
h := NewCompanyHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/companies/1/contacts/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "contact_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.RemoveContact(c) })
|
|
}
|
|
|
|
// ============ Contact Handler Tests ============
|
|
|
|
func TestContactHandler_List_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/contacts", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestContactHandler_Search_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/contacts/search?q=t", "1")
|
|
safeCall_Cov14(t, func() { h.Search(c) })
|
|
}
|
|
|
|
func TestContactHandler_Get_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/contacts/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestContactHandler_Create_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/contacts", "1", `{"name":"c"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestContactHandler_Update_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/contacts/1", "1", `{"name":"c"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestContactHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/contacts/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestContactHandler_InitiateCall_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/contacts/1/calls", "1", `{"inbox_id":1}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.InitiateCall(c) })
|
|
}
|
|
|
|
func TestContactHandler_DeleteAvatar_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/contacts/1/avatar", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DeleteAvatar(c) })
|
|
}
|
|
|
|
func TestContactHandler_ListLabels_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/contacts/1/labels", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ListLabels(c) })
|
|
}
|
|
|
|
func TestContactHandler_UpdateLabels_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/contacts/1/labels", "1", `{"labels":["a"]}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.UpdateLabels(c) })
|
|
}
|
|
|
|
func TestContactHandler_ListContactInboxes_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/contacts/1/contact_inboxes", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ListContactInboxes(c) })
|
|
}
|
|
|
|
func TestContactHandler_ListConversations_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/contacts/1/conversations", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ListConversations(c) })
|
|
}
|
|
|
|
func TestContactHandler_ListNotes_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/contacts/1/notes", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ListNotes(c) })
|
|
}
|
|
|
|
func TestContactHandler_CreateNote_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/contacts/1/notes", "1", `{"content":"n"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.CreateNote(c) })
|
|
}
|
|
|
|
func TestContactHandler_ShowNote_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/contacts/1/notes/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "note_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ShowNote(c) })
|
|
}
|
|
|
|
func TestContactHandler_UpdateNote_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PATCH", "/api/v1/accounts/1/contacts/1/notes/1", "1", `{"content":"n"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "note_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.UpdateNote(c) })
|
|
}
|
|
|
|
func TestContactHandler_DestroyNote_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/contacts/1/notes/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "note_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DestroyNote(c) })
|
|
}
|
|
|
|
func TestContactHandler_CreateContactInbox_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/contacts/1/contact_inboxes", "1", `{"inbox_id":1}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.CreateContactInbox(c) })
|
|
}
|
|
|
|
func TestContactHandler_DeleteContactInbox_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/contacts/1/contact_inboxes/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "source_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DeleteContactInbox(c) })
|
|
}
|
|
|
|
func TestContactHandler_Active_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/contacts/active", "1")
|
|
safeCall_Cov14(t, func() { h.Active(c) })
|
|
}
|
|
|
|
func TestContactHandler_Export_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/contacts/export", "1")
|
|
safeCall_Cov14(t, func() { h.Export(c) })
|
|
}
|
|
|
|
func TestContactHandler_ExportRequest_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/contacts/export_request", "1")
|
|
safeCall_Cov14(t, func() { h.ExportRequest(c) })
|
|
}
|
|
|
|
func TestContactHandler_DownloadExport_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/contacts/download_export", "1")
|
|
safeCall_Cov14(t, func() { h.DownloadExport(c) })
|
|
}
|
|
|
|
func TestContactHandler_Import_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/contacts/import", "1", `[{"name":"c"}]`)
|
|
safeCall_Cov14(t, func() { h.Import(c) })
|
|
}
|
|
|
|
func TestContactHandler_ContactableInboxes_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/contacts/1/contactable_inboxes", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ContactableInboxes(c) })
|
|
}
|
|
|
|
func TestContactHandler_ListAttachments_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/contacts/1/attachments", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ListAttachments(c) })
|
|
}
|
|
|
|
func TestContactHandler_DeleteCustomAttributes_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/contacts/1/custom_attributes", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DeleteCustomAttributes(c) })
|
|
}
|
|
|
|
func TestContactHandler_Merge_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/contacts/1/merge", "1", `{"base_id":1,"mergee_id":2}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Merge(c) })
|
|
}
|
|
|
|
func TestContactHandler_Filter_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/contacts/filter", "1", `{"query":{}}`)
|
|
safeCall_Cov14(t, func() { h.Filter(c) })
|
|
}
|
|
|
|
func TestContactHandler_DestroyCustomAttributes_Cov14(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/contacts/1/custom_attributes_destroy", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DestroyCustomAttributes(c) })
|
|
}
|
|
|
|
// ============ Contact Inbox Handler Tests ============
|
|
|
|
func TestContactInboxHandler_Filter_Cov14(t *testing.T) {
|
|
h := NewContactInboxHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/contact_inboxes/filter", "1", `{"inbox_id":1}`)
|
|
safeCall_Cov14(t, func() { h.Filter(c) })
|
|
}
|
|
|
|
// ============ Contact Merge Handler Tests ============
|
|
|
|
func TestContactMergeHandler_Create_Cov14(t *testing.T) {
|
|
h := NewContactMergeHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/contacts/merge", "1", `{"base_id":1,"mergee_id":2}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
// ============ Conversation Insight Handler Tests ============
|
|
|
|
func TestConversationInsightHandler_AnalyzeParticipants_Cov14(t *testing.T) {
|
|
h := NewConversationInsightHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/conversations/1/insights/analyze_participants", "1", `{}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.AnalyzeParticipants(c) })
|
|
}
|
|
|
|
func TestConversationInsightHandler_ExtractActionItems_Cov14(t *testing.T) {
|
|
h := NewConversationInsightHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/conversations/1/insights/extract_action_items", "1", `{}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ExtractActionItems(c) })
|
|
}
|
|
|
|
func TestConversationInsightHandler_SuggestLabels_Cov14(t *testing.T) {
|
|
h := NewConversationInsightHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/conversations/1/insights/suggest_labels", "1", `{}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.SuggestLabels(c) })
|
|
}
|
|
|
|
// ============ Conversation Participant Handler Tests ============
|
|
|
|
func TestConversationParticipantHandler_List_Cov14(t *testing.T) {
|
|
h := NewConversationParticipantHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/conversations/1/participants", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "conversation_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestConversationParticipantHandler_Add_Cov14(t *testing.T) {
|
|
h := NewConversationParticipantHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/conversations/1/participants", "1", `{"user_id":1}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "conversation_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Add(c) })
|
|
}
|
|
|
|
func TestConversationParticipantHandler_Update_Cov14(t *testing.T) {
|
|
h := NewConversationParticipantHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PATCH", "/api/v1/accounts/1/conversations/1/participants/1", "1", `{"role":"admin"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "conversation_id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestConversationParticipantHandler_Remove_Cov14(t *testing.T) {
|
|
h := NewConversationParticipantHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/conversations/1/participants/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "conversation_id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Remove(c) })
|
|
}
|
|
|
|
func TestConversationParticipantHandler_Destroy_Cov14(t *testing.T) {
|
|
h := NewConversationParticipantHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/conversations/1/participants", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "conversation_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Destroy(c) })
|
|
}
|
|
|
|
func TestConversationParticipantHandler_BatchUpdate_Cov14(t *testing.T) {
|
|
h := NewConversationParticipantHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/conversations/1/participants/batch_update", "1", `{"user_ids":[1]}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "conversation_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.BatchUpdate(c) })
|
|
}
|
|
|
|
// ============ Copilot Config Handler Tests ============
|
|
|
|
func TestCopilotConfigHandler_PlatformGet_Cov14(t *testing.T) {
|
|
h := NewCopilotConfigHandler(nil, nil)
|
|
c, _ := newCtx_Cov14("GET", "/platform/api/v1/copilot_config")
|
|
safeCall_Cov14(t, func() { h.PlatformGet(c) })
|
|
}
|
|
|
|
func TestCopilotConfigHandler_PlatformUpdate_Cov14(t *testing.T) {
|
|
h := NewCopilotConfigHandler(nil, nil)
|
|
c, _ := newCtxBody_Cov14("PUT", "/platform/api/v1/copilot_config", `{"enabled":true}`)
|
|
safeCall_Cov14(t, func() { h.PlatformUpdate(c) })
|
|
}
|
|
|
|
func TestCopilotConfigHandler_PlatformTest_Cov14(t *testing.T) {
|
|
h := NewCopilotConfigHandler(nil, nil)
|
|
c, _ := newCtxBody_Cov14("POST", "/platform/api/v1/copilot_config/test", `{}`)
|
|
safeCall_Cov14(t, func() { h.PlatformTest(c) })
|
|
}
|
|
|
|
func TestCopilotConfigHandler_PlatformEmbeddingReindexStatus_Cov14(t *testing.T) {
|
|
h := NewCopilotConfigHandler(nil, nil)
|
|
c, _ := newCtx_Cov14("GET", "/platform/api/v1/copilot_config/embedding_reindex/status")
|
|
safeCall_Cov14(t, func() { h.PlatformEmbeddingReindexStatus(c) })
|
|
}
|
|
|
|
func TestCopilotConfigHandler_PlatformEmbeddingReindexStart_Cov14(t *testing.T) {
|
|
h := NewCopilotConfigHandler(nil, nil)
|
|
c, _ := newCtx_Cov14("POST", "/platform/api/v1/copilot_config/embedding_reindex/start")
|
|
safeCall_Cov14(t, func() { h.PlatformEmbeddingReindexStart(c) })
|
|
}
|
|
|
|
func TestCopilotConfigHandler_AccountGet_Cov14(t *testing.T) {
|
|
h := NewCopilotConfigHandler(nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/copilot_config", "1")
|
|
safeCall_Cov14(t, func() { h.AccountGet(c) })
|
|
}
|
|
|
|
func TestCopilotConfigHandler_AccountUpdate_Cov14(t *testing.T) {
|
|
h := NewCopilotConfigHandler(nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/copilot_config", "1", `{"enabled":true}`)
|
|
safeCall_Cov14(t, func() { h.AccountUpdate(c) })
|
|
}
|
|
|
|
// ============ Copilot Handler Tests ============
|
|
|
|
func TestCopilotHandler_CreateThread_Cov14(t *testing.T) {
|
|
h := NewCopilotHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/copilot/threads", "1", `{}`)
|
|
safeCall_Cov14(t, func() { h.CreateThread(c) })
|
|
}
|
|
|
|
func TestCopilotHandler_GetThread_Cov14(t *testing.T) {
|
|
h := NewCopilotHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/copilot/threads/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.GetThread(c) })
|
|
}
|
|
|
|
func TestCopilotHandler_ListThreads_Cov14(t *testing.T) {
|
|
h := NewCopilotHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/copilot/threads", "1")
|
|
safeCall_Cov14(t, func() { h.ListThreads(c) })
|
|
}
|
|
|
|
func TestCopilotHandler_SendMessage_Cov14(t *testing.T) {
|
|
h := NewCopilotHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/copilot/threads/1/messages", "1", `{"content":"hi"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.SendMessage(c) })
|
|
}
|
|
|
|
func TestCopilotHandler_GetSuggestedReplies_Cov14(t *testing.T) {
|
|
h := NewCopilotHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/copilot/suggested_replies?conversation_id=1", "1")
|
|
safeCall_Cov14(t, func() { h.GetSuggestedReplies(c) })
|
|
}
|
|
|
|
func TestCopilotHandler_SummarizeConversation_Cov14(t *testing.T) {
|
|
h := NewCopilotHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/copilot/summarize?conversation_id=1", "1")
|
|
safeCall_Cov14(t, func() { h.SummarizeConversation(c) })
|
|
}
|
|
|
|
func TestCopilotHandler_DeleteThread_Cov14(t *testing.T) {
|
|
h := NewCopilotHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/copilot/threads/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DeleteThread(c) })
|
|
}
|
|
|
|
func TestCopilotHandler_TranslateMessage_Cov14(t *testing.T) {
|
|
h := NewCopilotHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/copilot/translate", "1", `{"message":"hi","target_language":"es"}`)
|
|
safeCall_Cov14(t, func() { h.TranslateMessage(c) })
|
|
}
|
|
|
|
func TestCopilotHandler_ListSuggestionMessages_Cov14(t *testing.T) {
|
|
h := NewCopilotHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/copilot/suggestion_messages?conversation_id=1", "1")
|
|
safeCall_Cov14(t, func() { h.ListSuggestionMessages(c) })
|
|
}
|
|
|
|
func TestCopilotHandler_CreateSuggestionMessage_Cov14(t *testing.T) {
|
|
h := NewCopilotHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/copilot/suggestion_messages", "1", `{"conversation_id":1,"content":"hi"}`)
|
|
safeCall_Cov14(t, func() { h.CreateSuggestionMessage(c) })
|
|
}
|
|
|
|
// ============ Csat Metrics Handler Tests ============
|
|
|
|
func TestCsatMetricsHandler_Metrics_Cov14(t *testing.T) {
|
|
h := NewCsatMetricsHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/csat_metrics", "1")
|
|
safeCall_Cov14(t, func() { h.Metrics(c) })
|
|
}
|
|
|
|
func TestCsatMetricsHandler_Download_Cov14(t *testing.T) {
|
|
h := NewCsatMetricsHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/csat_metrics/download", "1")
|
|
safeCall_Cov14(t, func() { h.Download(c) })
|
|
}
|
|
|
|
// ============ Csat Survey Handler Tests ============
|
|
|
|
func TestCsatSurveyHandler_List_Cov14(t *testing.T) {
|
|
h := NewCsatSurveyHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/csat_survey_responses", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestCsatSurveyHandler_Metrics_Cov14(t *testing.T) {
|
|
h := NewCsatSurveyHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/csat_survey_responses/metrics", "1")
|
|
safeCall_Cov14(t, func() { h.Metrics(c) })
|
|
}
|
|
|
|
func TestCsatSurveyHandler_UpdateReviewNotes_Cov14(t *testing.T) {
|
|
h := NewCsatSurveyHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PATCH", "/api/v1/accounts/1/csat_survey_responses/1/update_review_notes", "1", `{"notes":"n"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.UpdateReviewNotes(c) })
|
|
}
|
|
|
|
func TestCsatSurveyHandler_Update_Cov14(t *testing.T) {
|
|
h := NewCsatSurveyHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/csat_survey_responses/1", "1", `{"rating":5}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestCsatSurveyHandler_PublicGet_Cov14(t *testing.T) {
|
|
h := NewCsatSurveyHandler(nil)
|
|
c, _ := newCtx_Cov14("GET", "/api/v1/csat_survey/1")
|
|
c.Params = append(c.Params, gin.Param{Key: "uuid", Value: "test-uuid"})
|
|
safeCall_Cov14(t, func() { h.PublicGet(c) })
|
|
}
|
|
|
|
func TestCsatSurveyHandler_PublicUpdate_Cov14(t *testing.T) {
|
|
h := NewCsatSurveyHandler(nil)
|
|
c, _ := newCtxBody_Cov14("PATCH", "/api/v1/csat_survey/1", `{"rating":5}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "uuid", Value: "test-uuid"})
|
|
safeCall_Cov14(t, func() { h.PublicUpdate(c) })
|
|
}
|
|
|
|
func TestCsatSurveyHandler_Download_Cov14(t *testing.T) {
|
|
h := NewCsatSurveyHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/csat_survey_responses/download", "1")
|
|
safeCall_Cov14(t, func() { h.Download(c) })
|
|
}
|
|
|
|
// ============ Custom Attribute Definition Handler Tests ============
|
|
|
|
func TestCustomAttributeDefinitionHandler_List_Cov14(t *testing.T) {
|
|
h := NewCustomAttributeDefinitionHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/custom_attribute_definitions", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestCustomAttributeDefinitionHandler_Get_Cov14(t *testing.T) {
|
|
h := NewCustomAttributeDefinitionHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/custom_attribute_definitions/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestCustomAttributeDefinitionHandler_Create_Cov14(t *testing.T) {
|
|
h := NewCustomAttributeDefinitionHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/custom_attribute_definitions", "1", `{"name":"a"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestCustomAttributeDefinitionHandler_Update_Cov14(t *testing.T) {
|
|
h := NewCustomAttributeDefinitionHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/custom_attribute_definitions/1", "1", `{"name":"a"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestCustomAttributeDefinitionHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewCustomAttributeDefinitionHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/custom_attribute_definitions/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
// ============ Custom Attribute Value Handler Tests ============
|
|
|
|
func TestCustomAttributeValueHandler_SetConversationAttribute_Cov14(t *testing.T) {
|
|
h := NewCustomAttributeValueHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/conversations/1/custom_attributes", "1", `{"attribute_id":1,"value":"v"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "conversation_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.SetConversationAttribute(c) })
|
|
}
|
|
|
|
func TestCustomAttributeValueHandler_RemoveConversationAttribute_Cov14(t *testing.T) {
|
|
h := NewCustomAttributeValueHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/conversations/1/custom_attributes/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "conversation_id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.RemoveConversationAttribute(c) })
|
|
}
|
|
|
|
func TestCustomAttributeValueHandler_SetContactAttribute_Cov14(t *testing.T) {
|
|
h := NewCustomAttributeValueHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/contacts/1/custom_attributes", "1", `{"attribute_id":1,"value":"v"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "contact_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.SetContactAttribute(c) })
|
|
}
|
|
|
|
func TestCustomAttributeValueHandler_RemoveContactAttribute_Cov14(t *testing.T) {
|
|
h := NewCustomAttributeValueHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/contacts/1/custom_attributes/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "contact_id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.RemoveContactAttribute(c) })
|
|
}
|
|
|
|
// ============ Custom Filter Handler Tests ============
|
|
|
|
func TestCustomFilterHandler_List_Cov14(t *testing.T) {
|
|
h := NewCustomFilterHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/custom_filters", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestCustomFilterHandler_Get_Cov14(t *testing.T) {
|
|
h := NewCustomFilterHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/custom_filters/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestCustomFilterHandler_Create_Cov14(t *testing.T) {
|
|
h := NewCustomFilterHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/custom_filters", "1", `{"name":"f"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestCustomFilterHandler_Update_Cov14(t *testing.T) {
|
|
h := NewCustomFilterHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/custom_filters/1", "1", `{"name":"f"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestCustomFilterHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewCustomFilterHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/custom_filters/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
// ============ Custom Role Handler Tests ============
|
|
|
|
func TestCustomRoleHandler_List_Cov14(t *testing.T) {
|
|
h := NewCustomRoleHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/custom_roles", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestCustomRoleHandler_Create_Cov14(t *testing.T) {
|
|
h := NewCustomRoleHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/custom_roles", "1", `{"name":"r"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestCustomRoleHandler_Get_Cov14(t *testing.T) {
|
|
h := NewCustomRoleHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/custom_roles/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestCustomRoleHandler_Update_Cov14(t *testing.T) {
|
|
h := NewCustomRoleHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/custom_roles/1", "1", `{"name":"r"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestCustomRoleHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewCustomRoleHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/custom_roles/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
// ============ Dashboard App Handler Tests ============
|
|
|
|
func TestDashboardAppHandler_Create_Cov14(t *testing.T) {
|
|
h := NewDashboardAppHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/dashboard_apps", "1", `{"name":"d"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestDashboardAppHandler_Get_Cov14(t *testing.T) {
|
|
h := NewDashboardAppHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/dashboard_apps/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestDashboardAppHandler_Update_Cov14(t *testing.T) {
|
|
h := NewDashboardAppHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/dashboard_apps/1", "1", `{"name":"d"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestDashboardAppHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewDashboardAppHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/dashboard_apps/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestDashboardAppHandler_Patch_Cov14(t *testing.T) {
|
|
h := NewDashboardAppHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PATCH", "/api/v1/accounts/1/dashboard_apps/1", "1", `{"name":"d"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Patch(c) })
|
|
}
|
|
|
|
func TestDashboardAppHandler_List_Cov14(t *testing.T) {
|
|
h := NewDashboardAppHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/dashboard_apps", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestDashboardAppHandler_Search_Cov14(t *testing.T) {
|
|
h := NewDashboardAppHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/dashboard_apps/search?q=t", "1")
|
|
safeCall_Cov14(t, func() { h.Search(c) })
|
|
}
|
|
|
|
func TestDashboardAppHandler_GetWidgets_Cov14(t *testing.T) {
|
|
h := NewDashboardAppHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/dashboard_apps/1/widgets", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.GetWidgets(c) })
|
|
}
|
|
|
|
func TestDashboardAppHandler_AddWidget_Cov14(t *testing.T) {
|
|
h := NewDashboardAppHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/dashboard_apps/1/widgets", "1", `{"widget_id":1}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.AddWidget(c) })
|
|
}
|
|
|
|
func TestDashboardAppHandler_RemoveWidget_Cov14(t *testing.T) {
|
|
h := NewDashboardAppHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/dashboard_apps/1/widgets/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "widget_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.RemoveWidget(c) })
|
|
}
|
|
|
|
func TestDashboardAppHandler_UpdateWidget_Cov14(t *testing.T) {
|
|
h := NewDashboardAppHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PATCH", "/api/v1/accounts/1/dashboard_apps/1/widgets/1", "1", `{"position":0}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "widget_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.UpdateWidget(c) })
|
|
}
|
|
|
|
// ============ Delivery Status Handler Tests ============
|
|
|
|
func TestDeliveryStatusHandler_List_Cov14(t *testing.T) {
|
|
h := NewDeliveryStatusHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/delivery_statuses", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
// ============ Draft Message Handler Tests ============
|
|
|
|
func TestDraftMessageHandler_Show_Cov14(t *testing.T) {
|
|
h := NewDraftMessageHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/conversations/1/draft_messages", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "conversation_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Show(c) })
|
|
}
|
|
|
|
func TestDraftMessageHandler_UpdateConversationDraft_Cov14(t *testing.T) {
|
|
h := NewDraftMessageHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/conversations/1/draft_messages", "1", `{"content":"d"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "conversation_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.UpdateConversationDraft(c) })
|
|
}
|
|
|
|
func TestDraftMessageHandler_DeleteConversationDraft_Cov14(t *testing.T) {
|
|
h := NewDraftMessageHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/conversations/1/draft_messages", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "conversation_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DeleteConversationDraft(c) })
|
|
}
|
|
|
|
func TestDraftMessageHandler_List_Cov14(t *testing.T) {
|
|
h := NewDraftMessageHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/draft_messages", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestDraftMessageHandler_Create_Cov14(t *testing.T) {
|
|
h := NewDraftMessageHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/draft_messages", "1", `{"content":"d"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestDraftMessageHandler_Get_Cov14(t *testing.T) {
|
|
h := NewDraftMessageHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/draft_messages/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestDraftMessageHandler_Update_Cov14(t *testing.T) {
|
|
h := NewDraftMessageHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/draft_messages/1", "1", `{"content":"d"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestDraftMessageHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewDraftMessageHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/draft_messages/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestDraftMessageHandler_Search_Cov14(t *testing.T) {
|
|
h := NewDraftMessageHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/draft_messages/search?q=t", "1")
|
|
safeCall_Cov14(t, func() { h.Search(c) })
|
|
}
|
|
|
|
func TestDraftMessageHandler_Count_Cov14(t *testing.T) {
|
|
h := NewDraftMessageHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/draft_messages/count", "1")
|
|
safeCall_Cov14(t, func() { h.Count(c) })
|
|
}
|
|
|
|
// ============ Dyte Integration Handler Tests ============
|
|
|
|
func TestDyteIntegrationHandler_CreateMeeting_Cov14(t *testing.T) {
|
|
h := NewDyteIntegrationHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/dyte/meetings", "1", `{"title":"m"}`)
|
|
safeCall_Cov14(t, func() { h.CreateMeeting(c) })
|
|
}
|
|
|
|
func TestDyteIntegrationHandler_AddParticipant_Cov14(t *testing.T) {
|
|
h := NewDyteIntegrationHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/dyte/meetings/1/participants", "1", `{"name":"p"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.AddParticipant(c) })
|
|
}
|
|
|
|
// ============ Enterprise Account Handler Tests ============
|
|
|
|
func TestEnterpriseAccountHandler_Limits_Cov14(t *testing.T) {
|
|
h := NewEnterpriseAccountHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/enterprise/limits", "1")
|
|
safeCall_Cov14(t, func() { h.Limits(c) })
|
|
}
|
|
|
|
func TestEnterpriseAccountHandler_ToggleDeletion_Cov14(t *testing.T) {
|
|
h := NewEnterpriseAccountHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/enterprise/toggle_deletion", "1", `{"delete":true}`)
|
|
safeCall_Cov14(t, func() { h.ToggleDeletion(c) })
|
|
}
|
|
|
|
func TestEnterpriseAccountHandler_Subscription_Cov14(t *testing.T) {
|
|
h := NewEnterpriseAccountHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/enterprise/subscription", "1")
|
|
safeCall_Cov14(t, func() { h.Subscription(c) })
|
|
}
|
|
|
|
func TestEnterpriseAccountHandler_Checkout_Cov14(t *testing.T) {
|
|
h := NewEnterpriseAccountHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/enterprise/checkout", "1", `{}`)
|
|
safeCall_Cov14(t, func() { h.Checkout(c) })
|
|
}
|
|
|
|
func TestEnterpriseAccountHandler_TopupCheckout_Cov14(t *testing.T) {
|
|
h := NewEnterpriseAccountHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/enterprise/topup_checkout", "1", `{}`)
|
|
safeCall_Cov14(t, func() { h.TopupCheckout(c) })
|
|
}
|
|
|
|
func TestEnterpriseAccountHandler_SelectBillingCurrency_Cov14(t *testing.T) {
|
|
h := NewEnterpriseAccountHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/enterprise/billing_currency", "1", `{"currency":"usd"}`)
|
|
safeCall_Cov14(t, func() { h.SelectBillingCurrency(c) })
|
|
}
|
|
|
|
func TestEnterpriseAccountHandler_TopupOptions_Cov14(t *testing.T) {
|
|
h := NewEnterpriseAccountHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/enterprise/topup_options", "1")
|
|
safeCall_Cov14(t, func() { h.TopupOptions(c) })
|
|
}
|
|
|
|
// ============ Folder Handler Tests ============
|
|
|
|
func TestFolderHandler_Create_Cov14(t *testing.T) {
|
|
h := NewFolderHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/folders", "1", `{"name":"f"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestFolderHandler_Get_Cov14(t *testing.T) {
|
|
h := NewFolderHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/folders/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestFolderHandler_Update_Cov14(t *testing.T) {
|
|
h := NewFolderHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/folders/1", "1", `{"name":"f"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestFolderHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewFolderHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/folders/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestFolderHandler_List_Cov14(t *testing.T) {
|
|
h := NewFolderHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/folders", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
// ============ Inbox Handler Tests ============
|
|
|
|
func TestInboxHandler_List_Cov14(t *testing.T) {
|
|
h := NewInboxHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/inboxes", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestInboxHandler_Get_Cov14(t *testing.T) {
|
|
h := NewInboxHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/inboxes/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestInboxHandler_Create_Cov14(t *testing.T) {
|
|
h := NewInboxHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/inboxes", "1", `{"name":"i","channel":{"type":"web_widget"}}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestInboxHandler_WhatsAppAuthorization_Cov14(t *testing.T) {
|
|
h := NewInboxHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/inboxes/1/whatsapp_authorization", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.WhatsAppAuthorization(c) })
|
|
}
|
|
|
|
func TestInboxHandler_Update_Cov14(t *testing.T) {
|
|
h := NewInboxHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PATCH", "/api/v1/accounts/1/inboxes/1", "1", `{"name":"i"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestInboxHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewInboxHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/inboxes/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestInboxHandler_SetAgentBot_Cov14(t *testing.T) {
|
|
h := NewInboxHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/inboxes/1/set_agent_bot", "1", `{"agent_bot_id":1}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.SetAgentBot(c) })
|
|
}
|
|
|
|
func TestInboxHandler_Health_Cov14(t *testing.T) {
|
|
h := NewInboxHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/inboxes/1/health", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Health(c) })
|
|
}
|
|
|
|
func TestInboxHandler_SyncTemplates_Cov14(t *testing.T) {
|
|
h := NewInboxHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/inboxes/1/sync_templates", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.SyncTemplates(c) })
|
|
}
|
|
|
|
func TestInboxHandler_RegisterWebhook_Cov14(t *testing.T) {
|
|
h := NewInboxHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/inboxes/1/register_webhook", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.RegisterWebhook(c) })
|
|
}
|
|
|
|
func TestInboxHandler_EnableWhatsAppCalling_Cov14(t *testing.T) {
|
|
h := NewInboxHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/inboxes/1/enable_whatsapp_calling", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.EnableWhatsAppCalling(c) })
|
|
}
|
|
|
|
func TestInboxHandler_DisableWhatsAppCalling_Cov14(t *testing.T) {
|
|
h := NewInboxHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/inboxes/1/disable_whatsapp_calling", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DisableWhatsAppCalling(c) })
|
|
}
|
|
|
|
func TestInboxHandler_SetInboundCalls_Cov14(t *testing.T) {
|
|
h := NewInboxHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/inboxes/1/set_inbound_calls", "1", `{"enabled":true}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.SetInboundCalls(c) })
|
|
}
|
|
|
|
func TestInboxHandler_GetAgentBot_Cov14(t *testing.T) {
|
|
h := NewInboxHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/inboxes/1/agent_bot", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.GetAgentBot(c) })
|
|
}
|
|
|
|
func TestInboxHandler_DeleteAvatar_Cov14(t *testing.T) {
|
|
h := NewInboxHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/inboxes/1/avatar", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DeleteAvatar(c) })
|
|
}
|
|
|
|
func TestInboxHandler_ListCampaigns_Cov14(t *testing.T) {
|
|
h := NewInboxHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/inboxes/1/campaigns", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ListCampaigns(c) })
|
|
}
|
|
|
|
func TestInboxHandler_ResetSecret_Cov14(t *testing.T) {
|
|
h := NewInboxHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/inboxes/1/reset_secret", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ResetSecret(c) })
|
|
}
|
|
|
|
// ============ Inbox Csat Template Handler Tests ============
|
|
|
|
func TestInboxCsatTemplateHandler_Show_Cov14(t *testing.T) {
|
|
h := NewInboxCsatTemplateHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/inboxes/1/csat_template", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Show(c) })
|
|
}
|
|
|
|
func TestInboxCsatTemplateHandler_Create_Cov14(t *testing.T) {
|
|
h := NewInboxCsatTemplateHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/inboxes/1/csat_template", "1", `{"enabled":true}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestInboxCsatTemplateHandler_Analyze_Cov14(t *testing.T) {
|
|
h := NewInboxCsatTemplateHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/inboxes/1/csat_template/analyze", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Analyze(c) })
|
|
}
|
|
|
|
// ============ Inbox Limit Handler Tests ============
|
|
|
|
func TestInboxLimitHandler_Create_Cov14(t *testing.T) {
|
|
h := NewInboxLimitHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/inbox_limits", "1", `{"inbox_id":1}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestInboxLimitHandler_Update_Cov14(t *testing.T) {
|
|
h := NewInboxLimitHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/inbox_limits/1", "1", `{"inbox_id":1}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestInboxLimitHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewInboxLimitHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/inbox_limits/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
// ============ Inbox Member Handler Tests ============
|
|
|
|
func TestInboxMemberHandler_ListMembers_Cov14(t *testing.T) {
|
|
h := NewInboxMemberHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/inboxes/1/members", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ListMembers(c) })
|
|
}
|
|
|
|
func TestInboxMemberHandler_AddMember_Cov14(t *testing.T) {
|
|
h := NewInboxMemberHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/inboxes/1/members", "1", `{"user_id":1}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.AddMember(c) })
|
|
}
|
|
|
|
func TestInboxMemberHandler_RemoveMember_Cov14(t *testing.T) {
|
|
h := NewInboxMemberHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/inboxes/1/members/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "user_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.RemoveMember(c) })
|
|
}
|
|
|
|
func TestInboxMemberHandler_UpdateMember_Cov14(t *testing.T) {
|
|
h := NewInboxMemberHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PATCH", "/api/v1/accounts/1/inboxes/1/members/1", "1", `{"role":"admin"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "user_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.UpdateMember(c) })
|
|
}
|
|
|
|
func TestInboxMemberHandler_UpdateMultiple_Cov14(t *testing.T) {
|
|
h := NewInboxMemberHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/inbox_members", "1", `{"user_ids":[1]}`)
|
|
safeCall_Cov14(t, func() { h.UpdateMultiple(c) })
|
|
}
|
|
|
|
func TestInboxMemberHandler_ShowAccountScoped_Cov14(t *testing.T) {
|
|
h := NewInboxMemberHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/inbox_members", "1")
|
|
safeCall_Cov14(t, func() { h.ShowAccountScoped(c) })
|
|
}
|
|
|
|
func TestInboxMemberHandler_CreateAccountScoped_Cov14(t *testing.T) {
|
|
h := NewInboxMemberHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/inbox_members", "1", `{"user_ids":[1],"inbox_ids":[1]}`)
|
|
safeCall_Cov14(t, func() { h.CreateAccountScoped(c) })
|
|
}
|
|
|
|
func TestInboxMemberHandler_UpdateAccountScoped_Cov14(t *testing.T) {
|
|
h := NewInboxMemberHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PATCH", "/api/v1/accounts/1/inbox_members", "1", `{"user_ids":[1],"inbox_ids":[1]}`)
|
|
safeCall_Cov14(t, func() { h.UpdateAccountScoped(c) })
|
|
}
|
|
|
|
func TestInboxMemberHandler_DestroyAccountScoped_Cov14(t *testing.T) {
|
|
h := NewInboxMemberHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("DELETE", "/api/v1/accounts/1/inbox_members", "1", `{"user_ids":[1],"inbox_ids":[1]}`)
|
|
safeCall_Cov14(t, func() { h.DestroyAccountScoped(c) })
|
|
}
|
|
|
|
// ============ Installation Config Handler Tests ============
|
|
|
|
func TestInstallationConfigHandler_List_Cov14(t *testing.T) {
|
|
h := NewInstallationConfigHandler(nil)
|
|
c, _ := newCtx_Cov14("GET", "/platform/api/v1/installation_configs")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestInstallationConfigHandler_Get_Cov14(t *testing.T) {
|
|
h := NewInstallationConfigHandler(nil)
|
|
c, _ := newCtx_Cov14("GET", "/platform/api/v1/installation_configs/key1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "key1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestInstallationConfigHandler_Create_Cov14(t *testing.T) {
|
|
h := NewInstallationConfigHandler(nil)
|
|
c, _ := newCtxBody_Cov14("POST", "/platform/api/v1/installation_configs", `{"name":"k","value":"v"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestInstallationConfigHandler_Update_Cov14(t *testing.T) {
|
|
h := NewInstallationConfigHandler(nil)
|
|
c, _ := newCtxBody_Cov14("PATCH", "/platform/api/v1/installation_configs/key1", `{"value":"v"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "key1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestInstallationConfigHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewInstallationConfigHandler(nil)
|
|
c, _ := newCtx_Cov14("DELETE", "/platform/api/v1/installation_configs/key1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "key1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
// ============ Integration Hook Handler Tests ============
|
|
|
|
func TestIntegrationHookHandler_CreateHook_Cov14(t *testing.T) {
|
|
h := NewIntegrationHookHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/integrations/hooks", "1", `{"url":"http://t.com"}`)
|
|
safeCall_Cov14(t, func() { h.CreateHook(c) })
|
|
}
|
|
|
|
func TestIntegrationHookHandler_UpdateHook_Cov14(t *testing.T) {
|
|
h := NewIntegrationHookHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/integrations/hooks/1", "1", `{"url":"http://t.com"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.UpdateHook(c) })
|
|
}
|
|
|
|
func TestIntegrationHookHandler_DeleteHook_Cov14(t *testing.T) {
|
|
h := NewIntegrationHookHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/integrations/hooks/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DeleteHook(c) })
|
|
}
|
|
|
|
func TestIntegrationHookHandler_ListHooks_Cov14(t *testing.T) {
|
|
h := NewIntegrationHookHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/integrations/hooks", "1")
|
|
safeCall_Cov14(t, func() { h.ListHooks(c) })
|
|
}
|
|
|
|
// ============ Label Handler Tests ============
|
|
|
|
func TestLabelHandler_CreateTag_Cov14(t *testing.T) {
|
|
h := NewLabelHandler(nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/labels", "1", `{"title":"t"}`)
|
|
safeCall_Cov14(t, func() { h.CreateTag(c) })
|
|
}
|
|
|
|
func TestLabelHandler_GetTag_Cov14(t *testing.T) {
|
|
h := NewLabelHandler(nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/labels/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.GetTag(c) })
|
|
}
|
|
|
|
func TestLabelHandler_ListTags_Cov14(t *testing.T) {
|
|
h := NewLabelHandler(nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/labels", "1")
|
|
safeCall_Cov14(t, func() { h.ListTags(c) })
|
|
}
|
|
|
|
func TestLabelHandler_UpdateTag_Cov14(t *testing.T) {
|
|
h := NewLabelHandler(nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/labels/1", "1", `{"title":"t"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.UpdateTag(c) })
|
|
}
|
|
|
|
func TestLabelHandler_DeleteTag_Cov14(t *testing.T) {
|
|
h := NewLabelHandler(nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/labels/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DeleteTag(c) })
|
|
}
|
|
|
|
// ============ Linear Integration Handler Tests ============
|
|
|
|
func TestLinearIntegrationHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewLinearIntegrationHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/integrations/linear", "1")
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestLinearIntegrationHandler_GetTeams_Cov14(t *testing.T) {
|
|
h := NewLinearIntegrationHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/integrations/linear/teams", "1")
|
|
safeCall_Cov14(t, func() { h.GetTeams(c) })
|
|
}
|
|
|
|
func TestLinearIntegrationHandler_GetTeamEntities_Cov14(t *testing.T) {
|
|
h := NewLinearIntegrationHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/integrations/linear/teams/1/entities", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "team_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.GetTeamEntities(c) })
|
|
}
|
|
|
|
func TestLinearIntegrationHandler_CreateIssue_Cov14(t *testing.T) {
|
|
h := NewLinearIntegrationHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/integrations/linear/issues", "1", `{"title":"i"}`)
|
|
safeCall_Cov14(t, func() { h.CreateIssue(c) })
|
|
}
|
|
|
|
func TestLinearIntegrationHandler_LinkIssue_Cov14(t *testing.T) {
|
|
h := NewLinearIntegrationHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/conversations/1/integrations/linear/link_issue", "1", `{"issue_id":"1"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "conversation_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.LinkIssue(c) })
|
|
}
|
|
|
|
func TestLinearIntegrationHandler_UnlinkIssue_Cov14(t *testing.T) {
|
|
h := NewLinearIntegrationHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/conversations/1/integrations/linear/link_issue/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "conversation_id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.UnlinkIssue(c) })
|
|
}
|
|
|
|
func TestLinearIntegrationHandler_SearchIssue_Cov14(t *testing.T) {
|
|
h := NewLinearIntegrationHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/integrations/linear/search?q=t", "1")
|
|
safeCall_Cov14(t, func() { h.SearchIssue(c) })
|
|
}
|
|
|
|
func TestLinearIntegrationHandler_GetLinkedIssues_Cov14(t *testing.T) {
|
|
h := NewLinearIntegrationHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/conversations/1/integrations/linear/issues", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "conversation_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.GetLinkedIssues(c) })
|
|
}
|
|
|
|
// ============ Live Report Handler Tests ============
|
|
|
|
func TestLiveReportHandler_ConversationMetrics_Cov14(t *testing.T) {
|
|
h := NewLiveReportHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/live_reports/conversation_metrics", "1")
|
|
safeCall_Cov14(t, func() { h.ConversationMetrics(c) })
|
|
}
|
|
|
|
func TestLiveReportHandler_GroupedConversationMetrics_Cov14(t *testing.T) {
|
|
h := NewLiveReportHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/live_reports/grouped_conversation_metrics", "1")
|
|
safeCall_Cov14(t, func() { h.GroupedConversationMetrics(c) })
|
|
}
|
|
|
|
// ============ Macro Handler Tests ============
|
|
|
|
func TestMacroHandler_Create_Cov14(t *testing.T) {
|
|
h := NewMacroHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/macros", "1", `{"name":"m"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestMacroHandler_Get_Cov14(t *testing.T) {
|
|
h := NewMacroHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/macros/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestMacroHandler_Update_Cov14(t *testing.T) {
|
|
h := NewMacroHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/macros/1", "1", `{"name":"m"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestMacroHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewMacroHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/macros/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestMacroHandler_List_Cov14(t *testing.T) {
|
|
h := NewMacroHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/macros", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
// ============ Message Handler Tests ============
|
|
|
|
func TestMessageHandler_List_Cov14(t *testing.T) {
|
|
h := NewMessageHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/conversations/1/messages", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "conversation_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestMessageHandler_Create_Cov14(t *testing.T) {
|
|
h := NewMessageHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/conversations/1/messages", "1", `{"content":"m"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "conversation_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestMessageHandler_Get_Cov14(t *testing.T) {
|
|
h := NewMessageHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/conversations/1/messages/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "conversation_id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestMessageHandler_Update_Cov14(t *testing.T) {
|
|
h := NewMessageHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/conversations/1/messages/1", "1", `{"content":"m"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "conversation_id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestMessageHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewMessageHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/conversations/1/messages/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "conversation_id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestMessageHandler_Search_Cov14(t *testing.T) {
|
|
h := NewMessageHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/conversations/1/messages/search?q=t", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "conversation_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Search(c) })
|
|
}
|
|
|
|
func TestMessageHandler_Retry_Cov14(t *testing.T) {
|
|
h := NewMessageHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/conversations/1/messages/1/retry", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "conversation_id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Retry(c) })
|
|
}
|
|
|
|
func TestMessageHandler_Translate_Cov14(t *testing.T) {
|
|
h := NewMessageHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/conversations/1/messages/1/translate?target_language=es", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "conversation_id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Translate(c) })
|
|
}
|
|
|
|
// ============ Note Handler Tests ============
|
|
|
|
func TestNoteHandler_Create_Cov14(t *testing.T) {
|
|
h := NewNoteHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/notes", "1", `{"content":"n"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestNoteHandler_Show_Cov14(t *testing.T) {
|
|
h := NewNoteHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/notes/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Show(c) })
|
|
}
|
|
|
|
func TestNoteHandler_Update_Cov14(t *testing.T) {
|
|
h := NewNoteHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/notes/1", "1", `{"content":"n"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestNoteHandler_Destroy_Cov14(t *testing.T) {
|
|
h := NewNoteHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/notes/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Destroy(c) })
|
|
}
|
|
|
|
func TestNoteHandler_List_Cov14(t *testing.T) {
|
|
h := NewNoteHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/notes", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
// ============ Notion Integration Handler Tests ============
|
|
|
|
func TestNotionIntegrationHandler_Authorization_Cov14(t *testing.T) {
|
|
h := NewNotionIntegrationHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/integrations/notion/authorization", "1")
|
|
safeCall_Cov14(t, func() { h.Authorization(c) })
|
|
}
|
|
|
|
func TestNotionIntegrationHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewNotionIntegrationHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/integrations/notion", "1")
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
// ============ Notification Handler Tests ============
|
|
|
|
func TestNotificationHandler_List_Cov14(t *testing.T) {
|
|
h := NewNotificationHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/notifications", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestNotificationHandler_Get_Cov14(t *testing.T) {
|
|
h := NewNotificationHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/notifications/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestNotificationHandler_Update_Cov14(t *testing.T) {
|
|
h := NewNotificationHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/notifications/1", "1", `{"read":true}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestNotificationHandler_MarkAllRead_Cov14(t *testing.T) {
|
|
h := NewNotificationHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/notifications/read_all", "1")
|
|
safeCall_Cov14(t, func() { h.MarkAllRead(c) })
|
|
}
|
|
|
|
func TestNotificationHandler_UnreadCount_Cov14(t *testing.T) {
|
|
h := NewNotificationHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/notifications/unread_count", "1")
|
|
safeCall_Cov14(t, func() { h.UnreadCount(c) })
|
|
}
|
|
|
|
func TestNotificationHandler_Snooze_Cov14(t *testing.T) {
|
|
h := NewNotificationHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/notifications/1/snooze", "1", `{"duration":3600}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Snooze(c) })
|
|
}
|
|
|
|
func TestNotificationHandler_Unread_Cov14(t *testing.T) {
|
|
h := NewNotificationHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/notifications/unread_count", "1")
|
|
safeCall_Cov14(t, func() { h.Unread(c) })
|
|
}
|
|
|
|
func TestNotificationHandler_Destroy_Cov14(t *testing.T) {
|
|
h := NewNotificationHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/notifications/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Destroy(c) })
|
|
}
|
|
|
|
func TestNotificationHandler_DestroyAll_Cov14(t *testing.T) {
|
|
h := NewNotificationHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/notifications/all", "1")
|
|
safeCall_Cov14(t, func() { h.DestroyAll(c) })
|
|
}
|
|
|
|
// ============ Notification Setting Handler Tests ============
|
|
|
|
func TestNotificationSettingHandler_Show_Cov14(t *testing.T) {
|
|
h := NewNotificationSettingHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/notification_settings", "1")
|
|
safeCall_Cov14(t, func() { h.Show(c) })
|
|
}
|
|
|
|
func TestNotificationSettingHandler_Update_Cov14(t *testing.T) {
|
|
h := NewNotificationSettingHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/notification_settings", "1", `{"email":true}`)
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
// ============ Notification Subscription Handler Tests ============
|
|
|
|
func TestNotificationSubscriptionHandler_Create_Cov14(t *testing.T) {
|
|
h := NewNotificationSubscriptionHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/notification_subscriptions", "1", `{"event_type":"c"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestNotificationSubscriptionHandler_Destroy_Cov14(t *testing.T) {
|
|
h := NewNotificationSubscriptionHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/notification_subscriptions/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Destroy(c) })
|
|
}
|
|
|
|
// ============ OIDC Handler Tests ============
|
|
|
|
func TestOIDCHandler_Authorize_Cov14(t *testing.T) {
|
|
h := NewOIDCHandler(nil, nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/oidc/authorize", "1")
|
|
safeCall_Cov14(t, func() { h.Authorize(c) })
|
|
}
|
|
|
|
func TestOIDCHandler_Callback_Cov14(t *testing.T) {
|
|
h := NewOIDCHandler(nil, nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/oidc/callback", "1")
|
|
safeCall_Cov14(t, func() { h.Callback(c) })
|
|
}
|
|
|
|
func TestOIDCHandler_GetConfig_Cov14(t *testing.T) {
|
|
h := NewOIDCHandler(nil, nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/oidc/config", "1")
|
|
safeCall_Cov14(t, func() { h.GetConfig(c) })
|
|
}
|
|
|
|
func TestOIDCHandler_UpdateConfig_Cov14(t *testing.T) {
|
|
h := NewOIDCHandler(nil, nil, nil, nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/oidc/config", "1", `{"enabled":true}`)
|
|
safeCall_Cov14(t, func() { h.UpdateConfig(c) })
|
|
}
|
|
|
|
func TestOIDCHandler_Discovery_Cov14(t *testing.T) {
|
|
h := NewOIDCHandler(nil, nil, nil, nil, nil)
|
|
c, _ := newCtx_Cov14("GET", "/.well-known/openid-configuration")
|
|
safeCall_Cov14(t, func() { h.Discovery(c) })
|
|
}
|
|
|
|
// ============ Platform Account Handler Tests ============
|
|
|
|
func TestPlatformAccountHandler_List_Cov14(t *testing.T) {
|
|
h := NewPlatformAccountHandler(nil, nil, nil)
|
|
c, _ := newCtx_Cov14("GET", "/platform/api/v1/accounts")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestPlatformAccountHandler_Show_Cov14(t *testing.T) {
|
|
h := NewPlatformAccountHandler(nil, nil, nil)
|
|
c, _ := newCtx_Cov14("GET", "/platform/api/v1/accounts/1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Show(c) })
|
|
}
|
|
|
|
func TestPlatformAccountHandler_Create_Cov14(t *testing.T) {
|
|
h := NewPlatformAccountHandler(nil, nil, nil)
|
|
c, _ := newCtxBody_Cov14("POST", "/platform/api/v1/accounts", `{"name":"a"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestPlatformAccountHandler_Update_Cov14(t *testing.T) {
|
|
h := NewPlatformAccountHandler(nil, nil, nil)
|
|
c, _ := newCtxBody_Cov14("PUT", "/platform/api/v1/accounts/1", `{"name":"a"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestPlatformAccountHandler_Destroy_Cov14(t *testing.T) {
|
|
h := NewPlatformAccountHandler(nil, nil, nil)
|
|
c, _ := newCtx_Cov14("DELETE", "/platform/api/v1/accounts/1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Destroy(c) })
|
|
}
|
|
|
|
// ============ Platform Account User Handler Tests ============
|
|
|
|
func TestPlatformAccountUserHandler_Index_Cov14(t *testing.T) {
|
|
h := NewPlatformAccountUserHandler(nil, nil, nil)
|
|
c, _ := newCtx_Cov14("GET", "/platform/api/v1/accounts/1/users")
|
|
c.Params = append(c.Params, gin.Param{Key: "account_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Index(c) })
|
|
}
|
|
|
|
func TestPlatformAccountUserHandler_Create_Cov14(t *testing.T) {
|
|
h := NewPlatformAccountUserHandler(nil, nil, nil)
|
|
c, _ := newCtxBody_Cov14("POST", "/platform/api/v1/accounts/1/users", `{"user_id":1}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "account_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestPlatformAccountUserHandler_Destroy_Cov14(t *testing.T) {
|
|
h := NewPlatformAccountUserHandler(nil, nil, nil)
|
|
c, _ := newCtx_Cov14("DELETE", "/platform/api/v1/accounts/1/users/1")
|
|
c.Params = append(c.Params, gin.Param{Key: "account_id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Destroy(c) })
|
|
}
|
|
|
|
// ============ Platform Agent Bot Handler Tests ============
|
|
|
|
func TestPlatformAgentBotHandler_List_Cov14(t *testing.T) {
|
|
h := NewPlatformAgentBotHandler(nil, nil)
|
|
c, _ := newCtx_Cov14("GET", "/platform/api/v1/agent_bots")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestPlatformAgentBotHandler_Show_Cov14(t *testing.T) {
|
|
h := NewPlatformAgentBotHandler(nil, nil)
|
|
c, _ := newCtx_Cov14("GET", "/platform/api/v1/agent_bots/1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Show(c) })
|
|
}
|
|
|
|
func TestPlatformAgentBotHandler_Create_Cov14(t *testing.T) {
|
|
h := NewPlatformAgentBotHandler(nil, nil)
|
|
c, _ := newCtxBody_Cov14("POST", "/platform/api/v1/agent_bots", `{"name":"b"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestPlatformAgentBotHandler_Update_Cov14(t *testing.T) {
|
|
h := NewPlatformAgentBotHandler(nil, nil)
|
|
c, _ := newCtxBody_Cov14("PUT", "/platform/api/v1/agent_bots/1", `{"name":"b"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestPlatformAgentBotHandler_Destroy_Cov14(t *testing.T) {
|
|
h := NewPlatformAgentBotHandler(nil, nil)
|
|
c, _ := newCtx_Cov14("DELETE", "/platform/api/v1/agent_bots/1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Destroy(c) })
|
|
}
|
|
|
|
func TestPlatformAgentBotHandler_DeleteAvatar_Cov14(t *testing.T) {
|
|
h := NewPlatformAgentBotHandler(nil, nil)
|
|
c, _ := newCtx_Cov14("DELETE", "/platform/api/v1/agent_bots/1/avatar")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DeleteAvatar(c) })
|
|
}
|
|
|
|
// ============ Platform App Handler Tests ============
|
|
|
|
func TestPlatformAppHandler_List_Cov14(t *testing.T) {
|
|
h := NewPlatformAppHandler(nil)
|
|
c, _ := newCtx_Cov14("GET", "/platform/api/v1/apps")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestPlatformAppHandler_Get_Cov14(t *testing.T) {
|
|
h := NewPlatformAppHandler(nil)
|
|
c, _ := newCtx_Cov14("GET", "/platform/api/v1/apps/1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestPlatformAppHandler_Create_Cov14(t *testing.T) {
|
|
h := NewPlatformAppHandler(nil)
|
|
c, _ := newCtxBody_Cov14("POST", "/platform/api/v1/apps", `{"name":"a"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestPlatformAppHandler_Update_Cov14(t *testing.T) {
|
|
h := NewPlatformAppHandler(nil)
|
|
c, _ := newCtxBody_Cov14("PUT", "/platform/api/v1/apps/1", `{"name":"a"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestPlatformAppHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewPlatformAppHandler(nil)
|
|
c, _ := newCtx_Cov14("DELETE", "/platform/api/v1/apps/1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestPlatformAppHandler_RegenerateAccessToken_Cov14(t *testing.T) {
|
|
h := NewPlatformAppHandler(nil)
|
|
c, _ := newCtx_Cov14("POST", "/platform/api/v1/apps/1/regenerate_access_token")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.RegenerateAccessToken(c) })
|
|
}
|
|
|
|
func TestPlatformAppHandler_ListAccessTokens_Cov14(t *testing.T) {
|
|
h := NewPlatformAppHandler(nil)
|
|
c, _ := newCtx_Cov14("GET", "/platform/api/v1/apps/1/access_tokens")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ListAccessTokens(c) })
|
|
}
|
|
|
|
func TestPlatformAppHandler_AddPermissible_Cov14(t *testing.T) {
|
|
h := NewPlatformAppHandler(nil)
|
|
c, _ := newCtxBody_Cov14("POST", "/platform/api/v1/apps/1/permissibles", `{"permissible_type":"a","permissible_id":1}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.AddPermissible(c) })
|
|
}
|
|
|
|
func TestPlatformAppHandler_RemovePermissible_Cov14(t *testing.T) {
|
|
h := NewPlatformAppHandler(nil)
|
|
c, _ := newCtx_Cov14("DELETE", "/platform/api/v1/apps/1/permissibles/1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "permissible_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.RemovePermissible(c) })
|
|
}
|
|
|
|
func TestPlatformAppHandler_ListPermissibles_Cov14(t *testing.T) {
|
|
h := NewPlatformAppHandler(nil)
|
|
c, _ := newCtx_Cov14("GET", "/platform/api/v1/apps/1/permissibles")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ListPermissibles(c) })
|
|
}
|
|
|
|
func TestPlatformAppHandler_Search_Cov14(t *testing.T) {
|
|
h := NewPlatformAppHandler(nil)
|
|
c, _ := newCtx_Cov14("GET", "/platform/api/v1/apps/search?q=t")
|
|
safeCall_Cov14(t, func() { h.Search(c) })
|
|
}
|
|
|
|
// ============ Platform User Handler Tests ============
|
|
|
|
func TestPlatformUserHandler_Show_Cov14(t *testing.T) {
|
|
h := NewPlatformUserHandler(nil)
|
|
c, _ := newCtx_Cov14("GET", "/platform/api/v1/users/1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Show(c) })
|
|
}
|
|
|
|
func TestPlatformUserHandler_Create_Cov14(t *testing.T) {
|
|
h := NewPlatformUserHandler(nil)
|
|
c, _ := newCtxBody_Cov14("POST", "/platform/api/v1/users", `{"name":"u","email":"u@u.com","password":"p"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestPlatformUserHandler_Login_Cov14(t *testing.T) {
|
|
h := NewPlatformUserHandler(nil)
|
|
c, _ := newCtxBody_Cov14("POST", "/platform/api/v1/users/login", `{"email":"u@u.com","password":"p"}`)
|
|
safeCall_Cov14(t, func() { h.Login(c) })
|
|
}
|
|
|
|
func TestPlatformUserHandler_Token_Cov14(t *testing.T) {
|
|
h := NewPlatformUserHandler(nil)
|
|
c, _ := newCtxBody_Cov14("POST", "/platform/api/v1/users/token", `{"grant_type":"password","email":"u@u.com","password":"p"}`)
|
|
safeCall_Cov14(t, func() { h.Token(c) })
|
|
}
|
|
|
|
func TestPlatformUserHandler_Update_Cov14(t *testing.T) {
|
|
h := NewPlatformUserHandler(nil)
|
|
c, _ := newCtxBody_Cov14("PUT", "/platform/api/v1/users/1", `{"name":"u"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestPlatformUserHandler_Destroy_Cov14(t *testing.T) {
|
|
h := NewPlatformUserHandler(nil)
|
|
c, _ := newCtx_Cov14("DELETE", "/platform/api/v1/users/1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Destroy(c) })
|
|
}
|
|
|
|
func TestPlatformUserHandler_List_Cov14(t *testing.T) {
|
|
h := NewPlatformUserHandler(nil)
|
|
c, _ := newCtx_Cov14("GET", "/platform/api/v1/users")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
// ============ Portal Handler Tests ============
|
|
|
|
func TestPortalHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewPortalHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/portals/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "portal_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestPortalHandler_List_Cov14(t *testing.T) {
|
|
h := NewPortalHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/portals", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestPortalHandler_Archive_Cov14(t *testing.T) {
|
|
h := NewPortalHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/portals/1/archive", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "portal_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Archive(c) })
|
|
}
|
|
|
|
func TestPortalHandler_RemoveLogo_Cov14(t *testing.T) {
|
|
h := NewPortalHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/portals/1/logo", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "portal_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.RemoveLogo(c) })
|
|
}
|
|
|
|
func TestPortalHandler_SendInstructions_Cov14(t *testing.T) {
|
|
h := NewPortalHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/portals/1/send_instructions", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "portal_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.SendInstructions(c) })
|
|
}
|
|
|
|
func TestPortalHandler_SSLStatus_Cov14(t *testing.T) {
|
|
h := NewPortalHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/portals/1/ssl_status", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "portal_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.SSLStatus(c) })
|
|
}
|
|
|
|
// ============ Portal Member Handler Tests ============
|
|
|
|
func TestPortalMemberHandler_Create_Cov14(t *testing.T) {
|
|
h := NewPortalMemberHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/portals/1/members", "1", `{"user_id":1}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "portal_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestPortalMemberHandler_Get_Cov14(t *testing.T) {
|
|
h := NewPortalMemberHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/portals/1/members/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "portal_id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestPortalMemberHandler_Update_Cov14(t *testing.T) {
|
|
h := NewPortalMemberHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/portals/1/members/1", "1", `{"role":"admin"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "portal_id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestPortalMemberHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewPortalMemberHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/portals/1/members/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "portal_id", Value: "1"})
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestPortalMemberHandler_List_Cov14(t *testing.T) {
|
|
h := NewPortalMemberHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/portals/1/members", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "portal_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
// ============ Profile Handler Tests ============
|
|
|
|
func TestProfileHandler_Get_Cov14(t *testing.T) {
|
|
h := NewProfileHandler(nil)
|
|
c, _ := newCtx_Cov14("GET", "/api/v1/profile")
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestProfileHandler_ListSessions_Cov14(t *testing.T) {
|
|
h := NewProfileHandler(nil)
|
|
c, _ := newCtx_Cov14("GET", "/api/v1/profile/sessions")
|
|
safeCall_Cov14(t, func() { h.ListSessions(c) })
|
|
}
|
|
|
|
func TestProfileHandler_RevokeSession_Cov14(t *testing.T) {
|
|
h := NewProfileHandler(nil)
|
|
c, _ := newCtx_Cov14("DELETE", "/api/v1/profile/sessions/1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.RevokeSession(c) })
|
|
}
|
|
|
|
func TestProfileHandler_Update_Cov14(t *testing.T) {
|
|
h := NewProfileHandler(nil)
|
|
c, _ := newCtxBody_Cov14("PUT", "/api/v1/profile", `{"name":"u"}`)
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestProfileHandler_UpdateAvatar_Cov14(t *testing.T) {
|
|
h := NewProfileHandler(nil)
|
|
c, _ := newCtxBody_Cov14("POST", "/api/v1/profile/avatar", `--boundary`)
|
|
safeCall_Cov14(t, func() { h.UpdateAvatar(c) })
|
|
}
|
|
|
|
func TestProfileHandler_SetAvailability_Cov14(t *testing.T) {
|
|
h := NewProfileHandler(nil)
|
|
c, _ := newCtxBody_Cov14("POST", "/api/v1/profile/availability", `{"availability":"online"}`)
|
|
safeCall_Cov14(t, func() { h.SetAvailability(c) })
|
|
}
|
|
|
|
func TestProfileHandler_SetAutoOffline_Cov14(t *testing.T) {
|
|
h := NewProfileHandler(nil)
|
|
c, _ := newCtxBody_Cov14("POST", "/api/v1/profile/auto_offline", `{"enabled":true}`)
|
|
safeCall_Cov14(t, func() { h.SetAutoOffline(c) })
|
|
}
|
|
|
|
func TestProfileHandler_SetActiveAccount_Cov14(t *testing.T) {
|
|
h := NewProfileHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/active_account", "1", `{"account_id":1}`)
|
|
safeCall_Cov14(t, func() { h.SetActiveAccount(c) })
|
|
}
|
|
|
|
func TestProfileHandler_ResendConfirmation_Cov14(t *testing.T) {
|
|
h := NewProfileHandler(nil)
|
|
c, _ := newCtx_Cov14("POST", "/api/v1/profile/resend_confirmation")
|
|
safeCall_Cov14(t, func() { h.ResendConfirmation(c) })
|
|
}
|
|
|
|
func TestProfileHandler_ResetAccessToken_Cov14(t *testing.T) {
|
|
h := NewProfileHandler(nil)
|
|
c, _ := newCtx_Cov14("POST", "/api/v1/profile/reset_access_token")
|
|
safeCall_Cov14(t, func() { h.ResetAccessToken(c) })
|
|
}
|
|
|
|
func TestProfileHandler_DeleteAvatar_Cov14(t *testing.T) {
|
|
h := NewProfileHandler(nil)
|
|
c, _ := newCtx_Cov14("DELETE", "/api/v1/profile/avatar")
|
|
safeCall_Cov14(t, func() { h.DeleteAvatar(c) })
|
|
}
|
|
|
|
// ============ Push Subscription Handler Tests ============
|
|
|
|
func TestPushSubscriptionHandler_List_Cov14(t *testing.T) {
|
|
h := NewPushSubscriptionHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/push_subscriptions", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestPushSubscriptionHandler_Create_Cov14(t *testing.T) {
|
|
h := NewPushSubscriptionHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/push_subscriptions", "1", `{"endpoint":"http://t.com"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestPushSubscriptionHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewPushSubscriptionHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/push_subscriptions/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
// ============ RAG Handler Tests ============
|
|
|
|
func TestRAGHandler_Query_Cov14(t *testing.T) {
|
|
h := NewRAGHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/rag/query", "1", `{"query":"test"}`)
|
|
safeCall_Cov14(t, func() { h.Query(c) })
|
|
}
|
|
|
|
func TestRAGHandler_IndexResponse_Cov14(t *testing.T) {
|
|
h := NewRAGHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/rag/index_response", "1", `{"query":"test"}`)
|
|
safeCall_Cov14(t, func() { h.IndexResponse(c) })
|
|
}
|
|
|
|
// ============ Reporting Event Handler Tests ============
|
|
|
|
func TestReportingEventHandler_List_Cov14(t *testing.T) {
|
|
h := NewReportingEventHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/reporting_events", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
// ============ Search Handler Tests ============
|
|
|
|
func TestSearchHandler_GlobalSearch_Cov14(t *testing.T) {
|
|
h := NewSearchHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/search?q=test", "1")
|
|
safeCall_Cov14(t, func() { h.GlobalSearch(c) })
|
|
}
|
|
|
|
func TestSearchHandler_SearchConversations_Cov14(t *testing.T) {
|
|
h := NewSearchHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/search/conversations?q=test", "1")
|
|
safeCall_Cov14(t, func() { h.SearchConversations(c) })
|
|
}
|
|
|
|
func TestSearchHandler_SearchMessages_Cov14(t *testing.T) {
|
|
h := NewSearchHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/search/messages?q=test", "1")
|
|
safeCall_Cov14(t, func() { h.SearchMessages(c) })
|
|
}
|
|
|
|
func TestSearchHandler_SearchContacts_Cov14(t *testing.T) {
|
|
h := NewSearchHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/search/contacts?q=test", "1")
|
|
safeCall_Cov14(t, func() { h.SearchContacts(c) })
|
|
}
|
|
|
|
func TestSearchHandler_SearchArticles_Cov14(t *testing.T) {
|
|
h := NewSearchHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/search/articles?q=test", "1")
|
|
safeCall_Cov14(t, func() { h.SearchArticles(c) })
|
|
}
|
|
|
|
// ============ Shopify Integration Handler Tests ============
|
|
|
|
func TestShopifyIntegrationHandler_Auth_Cov14(t *testing.T) {
|
|
h := NewShopifyIntegrationHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/integrations/shopify", "1", `{"shop_domain":"t.myshopify.com"}`)
|
|
safeCall_Cov14(t, func() { h.Auth(c) })
|
|
}
|
|
|
|
func TestShopifyIntegrationHandler_GetOrders_Cov14(t *testing.T) {
|
|
h := NewShopifyIntegrationHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/integrations/shopify", "1")
|
|
safeCall_Cov14(t, func() { h.GetOrders(c) })
|
|
}
|
|
|
|
func TestShopifyIntegrationHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewShopifyIntegrationHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/integrations/shopify", "1")
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestShopifyIntegrationHandler_Auth2_Cov14(t *testing.T) {
|
|
h := NewShopifyIntegrationHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/integrations/shopify", "1", `{"enabled":true}`)
|
|
safeCall_Cov14(t, func() { h.Auth(c) })
|
|
}
|
|
|
|
// ============ SLA Policy Handler Tests ============
|
|
|
|
func TestSlaPolicyHandler_Create_Cov14(t *testing.T) {
|
|
h := NewSlaPolicyHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/sla_policies", "1", `{"name":"s"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestSlaPolicyHandler_Get_Cov14(t *testing.T) {
|
|
h := NewSlaPolicyHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/sla_policies/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestSlaPolicyHandler_List_Cov14(t *testing.T) {
|
|
h := NewSlaPolicyHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/sla_policies", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestSlaPolicyHandler_Update_Cov14(t *testing.T) {
|
|
h := NewSlaPolicyHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/sla_policies/1", "1", `{"name":"s"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestSlaPolicyHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewSlaPolicyHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/sla_policies/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
// ============ Slack Integration Handler Tests ============
|
|
|
|
func TestSlackIntegrationHandler_Create_Cov14(t *testing.T) {
|
|
h := NewSlackIntegrationHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/integrations/slack", "1", `{"url":"http://t.com"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestSlackIntegrationHandler_Update_Cov14(t *testing.T) {
|
|
h := NewSlackIntegrationHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/integrations/slack/1", "1", `{"url":"http://t.com"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestSlackIntegrationHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewSlackIntegrationHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/integrations/slack/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestSlackIntegrationHandler_ListAllChannels_Cov14(t *testing.T) {
|
|
h := NewSlackIntegrationHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/integrations/slack/channels", "1")
|
|
safeCall_Cov14(t, func() { h.ListAllChannels(c) })
|
|
}
|
|
|
|
// ============ Summary Report Handler Tests ============
|
|
|
|
func TestSummaryReportHandler_Agent_Cov14(t *testing.T) {
|
|
h := NewSummaryReportHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/summary_reports/agent", "1")
|
|
safeCall_Cov14(t, func() { h.Agent(c) })
|
|
}
|
|
|
|
func TestSummaryReportHandler_Team_Cov14(t *testing.T) {
|
|
h := NewSummaryReportHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/summary_reports/team", "1")
|
|
safeCall_Cov14(t, func() { h.Team(c) })
|
|
}
|
|
|
|
func TestSummaryReportHandler_Inbox_Cov14(t *testing.T) {
|
|
h := NewSummaryReportHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/summary_reports/inbox", "1")
|
|
safeCall_Cov14(t, func() { h.Inbox(c) })
|
|
}
|
|
|
|
func TestSummaryReportHandler_Label_Cov14(t *testing.T) {
|
|
h := NewSummaryReportHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/summary_reports/label", "1")
|
|
safeCall_Cov14(t, func() { h.Label(c) })
|
|
}
|
|
|
|
func TestSummaryReportHandler_Channel_Cov14(t *testing.T) {
|
|
h := NewSummaryReportHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/summary_reports/channel", "1")
|
|
safeCall_Cov14(t, func() { h.Channel(c) })
|
|
}
|
|
|
|
// ============ Team Handler Tests ============
|
|
|
|
func TestTeamHandler_List_Cov14(t *testing.T) {
|
|
h := NewTeamHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/teams", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestTeamHandler_Get_Cov14(t *testing.T) {
|
|
h := NewTeamHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/teams/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestTeamHandler_Create_Cov14(t *testing.T) {
|
|
h := NewTeamHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/teams", "1", `{"name":"t"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestTeamHandler_Update_Cov14(t *testing.T) {
|
|
h := NewTeamHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/teams/1", "1", `{"name":"t"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestTeamHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewTeamHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/teams/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestTeamHandler_AddMembers_Cov14(t *testing.T) {
|
|
h := NewTeamHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/teams/1/members", "1", `{"user_ids":[1]}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.AddMembers(c) })
|
|
}
|
|
|
|
func TestTeamHandler_RemoveMembers_Cov14(t *testing.T) {
|
|
h := NewTeamHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("DELETE", "/api/v1/accounts/1/teams/1/members", "1", `{"user_ids":[1]}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.RemoveMembers(c) })
|
|
}
|
|
|
|
func TestTeamHandler_ListMembers_Cov14(t *testing.T) {
|
|
h := NewTeamHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/teams/1/members", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ListMembers(c) })
|
|
}
|
|
|
|
func TestTeamHandler_UpdateMembers_Cov14(t *testing.T) {
|
|
h := NewTeamHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PATCH", "/api/v1/accounts/1/teams/1/members", "1", `{"user_ids":[1]}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.UpdateMembers(c) })
|
|
}
|
|
|
|
// ============ Twilio Channel Handler Tests ============
|
|
|
|
func TestTwilioChannelHandler_Create_Cov14(t *testing.T) {
|
|
h := NewTwilioChannelHandler(nil, nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/twilio_channels", "1", `{"phone_number":"+1234567890"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestTwilioChannelHandler_Get_Cov14(t *testing.T) {
|
|
h := NewTwilioChannelHandler(nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/twilio_channels/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestTwilioChannelHandler_Update_Cov14(t *testing.T) {
|
|
h := NewTwilioChannelHandler(nil, nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/twilio_channels/1", "1", `{"name":"t"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestTwilioChannelHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewTwilioChannelHandler(nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/twilio_channels/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestTwilioChannelHandler_List_Cov14(t *testing.T) {
|
|
h := NewTwilioChannelHandler(nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/twilio_channels", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
// ============ Upload Handler Tests ============
|
|
|
|
func TestUploadHandler_Upload_Cov14(t *testing.T) {
|
|
h := NewUploadHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/uploads", "1", `{"file":"test"}`)
|
|
safeCall_Cov14(t, func() { h.Upload(c) })
|
|
}
|
|
|
|
// ============ Webhook Subscription Handler Tests ============
|
|
|
|
func TestWebhookSubscriptionHandler_List_Cov14(t *testing.T) {
|
|
h := NewWebhookSubscriptionHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/webhook_subscriptions", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestWebhookSubscriptionHandler_Get_Cov14(t *testing.T) {
|
|
h := NewWebhookSubscriptionHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/webhook_subscriptions/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestWebhookSubscriptionHandler_Create_Cov14(t *testing.T) {
|
|
h := NewWebhookSubscriptionHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/webhook_subscriptions", "1", `{"url":"http://t.com"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestWebhookSubscriptionHandler_Update_Cov14(t *testing.T) {
|
|
h := NewWebhookSubscriptionHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/webhook_subscriptions/1", "1", `{"url":"http://t.com"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestWebhookSubscriptionHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewWebhookSubscriptionHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/webhook_subscriptions/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestWebhookSubscriptionHandler_ListDeliveries_Cov14(t *testing.T) {
|
|
h := NewWebhookSubscriptionHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/webhook_subscriptions/1/deliveries", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ListDeliveries(c) })
|
|
}
|
|
|
|
// ============ Web Widget Handler Tests ============
|
|
|
|
func TestWebWidgetHandler_CreateWebWidgetInbox_Cov14(t *testing.T) {
|
|
h := NewWebWidgetHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/widget_inboxes", "1", `{"name":"w"}`)
|
|
safeCall_Cov14(t, func() { h.CreateWebWidgetInbox(c) })
|
|
}
|
|
|
|
func TestWebWidgetHandler_GetWebWidgetConfig_Cov14(t *testing.T) {
|
|
h := NewWebWidgetHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/inboxes/1/web_widget_config", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.GetWebWidgetConfig(c) })
|
|
}
|
|
|
|
func TestWebWidgetHandler_UpdateWebWidgetConfig_Cov14(t *testing.T) {
|
|
h := NewWebWidgetHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PATCH", "/api/v1/accounts/1/inboxes/1/web_widget_config", "1", `{"name":"w"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.UpdateWebWidgetConfig(c) })
|
|
}
|
|
|
|
func TestWebWidgetHandler_DeleteWebWidgetInbox_Cov14(t *testing.T) {
|
|
h := NewWebWidgetHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/widget_inboxes/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DeleteWebWidgetInbox(c) })
|
|
}
|
|
|
|
// ============ Web Widget Offline Handler Tests ============
|
|
|
|
func TestWebWidgetOfflineHandler_ListOfflineMessages_Cov14(t *testing.T) {
|
|
h := NewWebWidgetOfflineHandler(nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/inboxes/1/offline_messages", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ListOfflineMessages(c) })
|
|
}
|
|
|
|
func TestWebWidgetOfflineHandler_ListOfflineMessagesByInbox_Cov14(t *testing.T) {
|
|
h := NewWebWidgetOfflineHandler(nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/offline_messages", "1")
|
|
safeCall_Cov14(t, func() { h.ListOfflineMessagesByInbox(c) })
|
|
}
|
|
|
|
func TestWebWidgetOfflineHandler_DismissOfflineMessage_Cov14(t *testing.T) {
|
|
h := NewWebWidgetOfflineHandler(nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/offline_messages/1/dismiss", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DismissOfflineMessage(c) })
|
|
}
|
|
|
|
func TestWebWidgetOfflineHandler_ConvertOfflineMessage_Cov14(t *testing.T) {
|
|
h := NewWebWidgetOfflineHandler(nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/offline_messages/1/convert", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ConvertOfflineMessage(c) })
|
|
}
|
|
|
|
// ============ Web Widget PreChat Handler Tests ============
|
|
|
|
func TestWebWidgetPreChatHandler_GetPreChatForm_Cov14(t *testing.T) {
|
|
h := NewWebWidgetPreChatHandler(nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/inboxes/1/pre_chat_form", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.GetPreChatForm(c) })
|
|
}
|
|
|
|
func TestWebWidgetPreChatHandler_UpdatePreChatForm_Cov14(t *testing.T) {
|
|
h := NewWebWidgetPreChatHandler(nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PATCH", "/api/v1/accounts/1/inboxes/1/pre_chat_form", "1", `{"enabled":true}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.UpdatePreChatForm(c) })
|
|
}
|
|
|
|
func TestWebWidgetPreChatHandler_DeletePreChatForm_Cov14(t *testing.T) {
|
|
h := NewWebWidgetPreChatHandler(nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/inboxes/1/pre_chat_form", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DeletePreChatForm(c) })
|
|
}
|
|
|
|
// ============ Web Widget Theme Handler Tests ============
|
|
|
|
func TestWebWidgetThemeHandler_GetThemeConfig_Cov14(t *testing.T) {
|
|
h := NewWebWidgetThemeHandler(nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/inboxes/1/theme_config", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.GetThemeConfig(c) })
|
|
}
|
|
|
|
func TestWebWidgetThemeHandler_UpdateThemeConfig_Cov14(t *testing.T) {
|
|
h := NewWebWidgetThemeHandler(nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PATCH", "/api/v1/accounts/1/inboxes/1/theme_config", "1", `{"color":"#fff"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.UpdateThemeConfig(c) })
|
|
}
|
|
|
|
func TestWebWidgetThemeHandler_DeleteThemeConfig_Cov14(t *testing.T) {
|
|
h := NewWebWidgetThemeHandler(nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/inboxes/1/theme_config", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "inbox_id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DeleteThemeConfig(c) })
|
|
}
|
|
|
|
// ============ WhatsApp Call Handler Tests ============
|
|
|
|
func TestWhatsAppCallHandler_Index_Cov14(t *testing.T) {
|
|
h := NewWhatsAppCallHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/calls", "1")
|
|
safeCall_Cov14(t, func() { h.Index(c) })
|
|
}
|
|
|
|
func TestWhatsAppCallHandler_Show_Cov14(t *testing.T) {
|
|
h := NewWhatsAppCallHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/calls/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Show(c) })
|
|
}
|
|
|
|
func TestWhatsAppCallHandler_Initiate_Cov14(t *testing.T) {
|
|
h := NewWhatsAppCallHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/calls", "1", `{"contact_id":1}`)
|
|
safeCall_Cov14(t, func() { h.Initiate(c) })
|
|
}
|
|
|
|
func TestWhatsAppCallHandler_Accept_Cov14(t *testing.T) {
|
|
h := NewWhatsAppCallHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/calls/1/accept", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Accept(c) })
|
|
}
|
|
|
|
func TestWhatsAppCallHandler_Reject_Cov14(t *testing.T) {
|
|
h := NewWhatsAppCallHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/calls/1/reject", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Reject(c) })
|
|
}
|
|
|
|
func TestWhatsAppCallHandler_Terminate_Cov14(t *testing.T) {
|
|
h := NewWhatsAppCallHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/calls/1/terminate", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Terminate(c) })
|
|
}
|
|
|
|
func TestWhatsAppCallHandler_UploadRecording_Cov14(t *testing.T) {
|
|
h := NewWhatsAppCallHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/calls/1/recording", "1", `{"url":"http://t.com"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.UploadRecording(c) })
|
|
}
|
|
|
|
func TestWhatsAppCallHandler_Get_Cov14(t *testing.T) {
|
|
h := NewWhatsAppCallHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/calls/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestWhatsAppCallHandler_List_Cov14(t *testing.T) {
|
|
h := NewWhatsAppCallHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/calls", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestWhatsAppCallHandler_Create_Cov14(t *testing.T) {
|
|
h := NewWhatsAppCallHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/calls", "1", `{"contact_id":1}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestWhatsAppCallHandler_Update_Cov14(t *testing.T) {
|
|
h := NewWhatsAppCallHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/calls/1", "1", `{"status":"completed"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestWhatsAppCallHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewWhatsAppCallHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/calls/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
// ============ Widget Test Handler Tests ============
|
|
|
|
func TestWidgetTestHandler_Index_Cov14(t *testing.T) {
|
|
h := NewWidgetTestHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/widget_tests", "1")
|
|
safeCall_Cov14(t, func() { h.Index(c) })
|
|
}
|
|
|
|
func TestWidgetTestHandler_ListByType_Cov14(t *testing.T) {
|
|
h := NewWidgetTestHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/widget_tests?type=unit", "1")
|
|
safeCall_Cov14(t, func() { h.ListByType(c) })
|
|
}
|
|
|
|
// ============ Working Hour Handler Tests ============
|
|
|
|
func TestWorkingHourHandler_GetWeeklySchedule_Cov14(t *testing.T) {
|
|
h := NewWorkingHourHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/profile/working_hours", "1")
|
|
safeCall_Cov14(t, func() { h.GetWeeklySchedule(c) })
|
|
}
|
|
|
|
func TestWorkingHourHandler_UpdateWeeklySchedule_Cov14(t *testing.T) {
|
|
h := NewWorkingHourHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/profile/working_hours", "1", `[{"day":1}]`)
|
|
safeCall_Cov14(t, func() { h.UpdateWeeklySchedule(c) })
|
|
}
|
|
|
|
func TestWorkingHourHandler_IsOutOfOffice_Cov14(t *testing.T) {
|
|
h := NewWorkingHourHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/profile/is_out_of_office", "1")
|
|
safeCall_Cov14(t, func() { h.IsOutOfOffice(c) })
|
|
}
|
|
|
|
// ============ Year In Review Handler Tests ============
|
|
|
|
func TestYearInReviewHandler_Show_Cov14(t *testing.T) {
|
|
h := NewYearInReviewHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/year_in_review", "1")
|
|
safeCall_Cov14(t, func() { h.Show(c) })
|
|
}
|
|
|
|
// ============ Automation Rule Handler Tests ============
|
|
|
|
func TestAutomationRuleHandler_List_Cov14(t *testing.T) {
|
|
h := NewAutomationRuleHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/automation_rules", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
func TestAutomationRuleHandler_Get_Cov14(t *testing.T) {
|
|
h := NewAutomationRuleHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/automation_rules/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestAutomationRuleHandler_Create_Cov14(t *testing.T) {
|
|
h := NewAutomationRuleHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/automation_rules", "1", `{"name":"r"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestAutomationRuleHandler_Update_Cov14(t *testing.T) {
|
|
h := NewAutomationRuleHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/automation_rules/1", "1", `{"name":"r"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestAutomationRuleHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewAutomationRuleHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/automation_rules/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestAutomationRuleHandler_Clone_Cov14(t *testing.T) {
|
|
h := NewAutomationRuleHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/automation_rules/1/clone", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Clone(c) })
|
|
}
|
|
|
|
func TestAutomationRuleHandler_ToggleActive_Cov14(t *testing.T) {
|
|
h := NewAutomationRuleHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/automation_rules/1/toggle_active", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ToggleActive(c) })
|
|
}
|
|
|
|
// ============ Assignable Agent Handler Tests ============
|
|
|
|
func TestAssignableAgentHandler_List_Cov14(t *testing.T) {
|
|
h := NewAssignableAgentHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/assignable_agents", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
// ============ Captain Bulk Action Handler Tests ============
|
|
|
|
func TestCaptainBulkActionHandler_Execute_Cov14(t *testing.T) {
|
|
h := NewCaptainBulkActionHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/captain_bulk_actions", "1", `{"type":"conversation","action":"assign"}`)
|
|
safeCall_Cov14(t, func() { h.Execute(c) })
|
|
}
|
|
|
|
// ============ Email Channel Migration Handler Tests ============
|
|
|
|
func TestEmailChannelMigrationHandler_Create_Cov14(t *testing.T) {
|
|
h := NewEmailChannelMigrationHandler(nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/email_channel_migrations", "1", `{"inbox_id":1}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
// ============ Email Channel Handler Tests ============
|
|
|
|
func TestEmailChannelHandler_Create_Cov14(t *testing.T) {
|
|
h := NewEmailChannelHandler(nil, nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/email_channels", "1", `{"email":"t@t.com"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestEmailChannelHandler_Get_Cov14(t *testing.T) {
|
|
h := NewEmailChannelHandler(nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/email_channels/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestEmailChannelHandler_Update_Cov14(t *testing.T) {
|
|
h := NewEmailChannelHandler(nil, nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/email_channels/1", "1", `{"email":"t@t.com"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestEmailChannelHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewEmailChannelHandler(nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/email_channels/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestEmailChannelHandler_List_Cov14(t *testing.T) {
|
|
h := NewEmailChannelHandler(nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/email_channels", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
// ============ Facebook Channel Handler Tests ============
|
|
|
|
func TestFacebookChannelHandler_Authorization_Cov14(t *testing.T) {
|
|
h := NewFacebookChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/facebook/authorization", "1")
|
|
safeCall_Cov14(t, func() { h.Authorization(c) })
|
|
}
|
|
|
|
func TestFacebookChannelHandler_RegisterFacebookPage_Cov14(t *testing.T) {
|
|
h := NewFacebookChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/facebook/register_page", "1", `{"page_id":"1","page_access_token":"t"}`)
|
|
safeCall_Cov14(t, func() { h.RegisterFacebookPage(c) })
|
|
}
|
|
|
|
func TestFacebookChannelHandler_FacebookPages_Cov14(t *testing.T) {
|
|
h := NewFacebookChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/facebook/pages", "1")
|
|
safeCall_Cov14(t, func() { h.FacebookPages(c) })
|
|
}
|
|
|
|
func TestFacebookChannelHandler_OAuthCallback_Cov14(t *testing.T) {
|
|
h := NewFacebookChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/facebook/callback", "1")
|
|
safeCall_Cov14(t, func() { h.OAuthCallback(c) })
|
|
}
|
|
|
|
func TestFacebookChannelHandler_GetFacebookChannel_Cov14(t *testing.T) {
|
|
h := NewFacebookChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/facebook_channels/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.GetFacebookChannel(c) })
|
|
}
|
|
|
|
func TestFacebookChannelHandler_ListFacebookChannels_Cov14(t *testing.T) {
|
|
h := NewFacebookChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/facebook_channels", "1")
|
|
safeCall_Cov14(t, func() { h.ListFacebookChannels(c) })
|
|
}
|
|
|
|
func TestFacebookChannelHandler_DeleteFacebookPage_Cov14(t *testing.T) {
|
|
h := NewFacebookChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/facebook_channels/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DeleteFacebookPage(c) })
|
|
}
|
|
|
|
func TestFacebookChannelHandler_ReauthorizeFacebookPage_Cov14(t *testing.T) {
|
|
h := NewFacebookChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/facebook_channels/1/reauthorize", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ReauthorizeFacebookPage(c) })
|
|
}
|
|
|
|
func TestFacebookChannelHandler_UpdateFacebookPage_Cov14(t *testing.T) {
|
|
h := NewFacebookChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PATCH", "/api/v1/accounts/1/facebook_channels/1", "1", `{"name":"t"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.UpdateFacebookPage(c) })
|
|
}
|
|
|
|
// ============ Google Channel Handler Tests ============
|
|
|
|
func TestGoogleChannelHandler_Authorization_Cov14(t *testing.T) {
|
|
h := NewGoogleChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/google/authorization", "1")
|
|
safeCall_Cov14(t, func() { h.Authorization(c) })
|
|
}
|
|
|
|
func TestGoogleChannelHandler_ChatwootAuthorization_Cov14(t *testing.T) {
|
|
h := NewGoogleChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/google/chatwoot_authorization", "1")
|
|
safeCall_Cov14(t, func() { h.ChatwootAuthorization(c) })
|
|
}
|
|
|
|
func TestGoogleChannelHandler_OAuthCallback_Cov14(t *testing.T) {
|
|
h := NewGoogleChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/google/callback", "1")
|
|
safeCall_Cov14(t, func() { h.OAuthCallback(c) })
|
|
}
|
|
|
|
func TestGoogleChannelHandler_OAuthCallbackGET_Cov14(t *testing.T) {
|
|
h := NewGoogleChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/google/callback", "1")
|
|
safeCall_Cov14(t, func() { h.OAuthCallbackGET(c) })
|
|
}
|
|
|
|
func TestGoogleChannelHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewGoogleChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/google_channels/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestGoogleChannelHandler_RegisterWebhook_Cov14(t *testing.T) {
|
|
h := NewGoogleChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/google_channels/1/register_webhook", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.RegisterWebhook(c) })
|
|
}
|
|
|
|
func TestGoogleChannelHandler_ListWebhooks_Cov14(t *testing.T) {
|
|
h := NewGoogleChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/google_channels/1/webhooks", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ListWebhooks(c) })
|
|
}
|
|
|
|
// ============ Instagram Channel Handler Tests ============
|
|
|
|
func TestInstagramChannelHandler_Authorization_Cov14(t *testing.T) {
|
|
h := NewInstagramChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/instagram/authorization", "1")
|
|
safeCall_Cov14(t, func() { h.Authorization(c) })
|
|
}
|
|
|
|
func TestInstagramChannelHandler_ChatwootAuthorization_Cov14(t *testing.T) {
|
|
h := NewInstagramChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/instagram/chatwoot_authorization", "1")
|
|
safeCall_Cov14(t, func() { h.ChatwootAuthorization(c) })
|
|
}
|
|
|
|
func TestInstagramChannelHandler_OAuthCallback_Cov14(t *testing.T) {
|
|
h := NewInstagramChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/instagram/callback", "1")
|
|
safeCall_Cov14(t, func() { h.OAuthCallback(c) })
|
|
}
|
|
|
|
func TestInstagramChannelHandler_OAuthCallbackGET_Cov14(t *testing.T) {
|
|
h := NewInstagramChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/instagram/callback", "1")
|
|
safeCall_Cov14(t, func() { h.OAuthCallbackGET(c) })
|
|
}
|
|
|
|
func TestInstagramChannelHandler_RegisterWebhook_Cov14(t *testing.T) {
|
|
h := NewInstagramChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/instagram_channels/1/register_webhook", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.RegisterWebhook(c) })
|
|
}
|
|
|
|
func TestInstagramChannelHandler_ListWebhooks_Cov14(t *testing.T) {
|
|
h := NewInstagramChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/instagram_channels/1/webhooks", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ListWebhooks(c) })
|
|
}
|
|
|
|
func TestInstagramChannelHandler_CreateInstagramChannel_Cov14(t *testing.T) {
|
|
h := NewInstagramChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/instagram_channels", "1", `{"instagram_id":"1"}`)
|
|
safeCall_Cov14(t, func() { h.CreateInstagramChannel(c) })
|
|
}
|
|
|
|
func TestInstagramChannelHandler_DeleteInstagramChannel_Cov14(t *testing.T) {
|
|
h := NewInstagramChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/instagram_channels/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DeleteInstagramChannel(c) })
|
|
}
|
|
|
|
func TestInstagramChannelHandler_Reauthorize_Cov14(t *testing.T) {
|
|
h := NewInstagramChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/instagram_channels/1/reauthorize", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Reauthorize(c) })
|
|
}
|
|
|
|
func TestInstagramChannelHandler_GetInstagramChannel_Cov14(t *testing.T) {
|
|
h := NewInstagramChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/instagram_channels/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.GetInstagramChannel(c) })
|
|
}
|
|
|
|
func TestInstagramChannelHandler_ListInstagramChannels_Cov14(t *testing.T) {
|
|
h := NewInstagramChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/instagram_channels", "1")
|
|
safeCall_Cov14(t, func() { h.ListInstagramChannels(c) })
|
|
}
|
|
|
|
func TestInstagramChannelHandler_UpdateInstagramChannel_Cov14(t *testing.T) {
|
|
h := NewInstagramChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PATCH", "/api/v1/accounts/1/instagram_channels/1", "1", `{"name":"t"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.UpdateInstagramChannel(c) })
|
|
}
|
|
|
|
// ============ Microsoft Channel Handler Tests ============
|
|
|
|
func TestMicrosoftChannelHandler_Authorization_Cov14(t *testing.T) {
|
|
h := NewMicrosoftChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/microsoft/authorization", "1")
|
|
safeCall_Cov14(t, func() { h.Authorization(c) })
|
|
}
|
|
|
|
func TestMicrosoftChannelHandler_ChatwootAuthorization_Cov14(t *testing.T) {
|
|
h := NewMicrosoftChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/microsoft/chatwoot_authorization", "1")
|
|
safeCall_Cov14(t, func() { h.ChatwootAuthorization(c) })
|
|
}
|
|
|
|
func TestMicrosoftChannelHandler_OAuthCallback_Cov14(t *testing.T) {
|
|
h := NewMicrosoftChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/microsoft/callback", "1")
|
|
safeCall_Cov14(t, func() { h.OAuthCallback(c) })
|
|
}
|
|
|
|
func TestMicrosoftChannelHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewMicrosoftChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/microsoft_channels/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestMicrosoftChannelHandler_WebhookValidation_Cov14(t *testing.T) {
|
|
h := NewMicrosoftChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/microsoft/webhook_validation", "1")
|
|
safeCall_Cov14(t, func() { h.WebhookValidation(c) })
|
|
}
|
|
|
|
func TestMicrosoftChannelHandler_OAuthCallbackGET_Cov14(t *testing.T) {
|
|
h := NewMicrosoftChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/microsoft/callback", "1")
|
|
safeCall_Cov14(t, func() { h.OAuthCallbackGET(c) })
|
|
}
|
|
|
|
func TestMicrosoftChannelHandler_RegisterWebhook_Cov14(t *testing.T) {
|
|
h := NewMicrosoftChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/microsoft_channels/1/register_webhook", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.RegisterWebhook(c) })
|
|
}
|
|
|
|
func TestMicrosoftChannelHandler_ListWebhooks_Cov14(t *testing.T) {
|
|
h := NewMicrosoftChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/microsoft_channels/1/webhooks", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ListWebhooks(c) })
|
|
}
|
|
|
|
func TestMicrosoftChannelHandler_WebhookEvent_Cov14(t *testing.T) {
|
|
h := NewMicrosoftChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/microsoft_channels/1/webhook_event", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.WebhookEvent(c) })
|
|
}
|
|
|
|
// ============ Twitter Channel Handler Tests ============
|
|
|
|
func TestTwitterChannelHandler_Authorization_Cov14(t *testing.T) {
|
|
h := NewTwitterChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/twitter/authorization", "1")
|
|
safeCall_Cov14(t, func() { h.Authorization(c) })
|
|
}
|
|
|
|
func TestTwitterChannelHandler_ChatwootAuthorization_Cov14(t *testing.T) {
|
|
h := NewTwitterChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/twitter/chatwoot_authorization", "1")
|
|
safeCall_Cov14(t, func() { h.ChatwootAuthorization(c) })
|
|
}
|
|
|
|
func TestTwitterChannelHandler_OAuthCallback_Cov14(t *testing.T) {
|
|
h := NewTwitterChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/twitter/callback", "1")
|
|
safeCall_Cov14(t, func() { h.OAuthCallback(c) })
|
|
}
|
|
|
|
func TestTwitterChannelHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewTwitterChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/twitter_channels/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestTwitterChannelHandler_WebhookCRC_Cov14(t *testing.T) {
|
|
h := NewTwitterChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/twitter/webhooks/1/crc", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.WebhookCRC(c) })
|
|
}
|
|
|
|
func TestTwitterChannelHandler_WebhookEvent_Cov14(t *testing.T) {
|
|
h := NewTwitterChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/twitter/webhooks/1/event", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.WebhookEvent(c) })
|
|
}
|
|
|
|
func TestTwitterChannelHandler_RegisterWebhook_Cov14(t *testing.T) {
|
|
h := NewTwitterChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("POST", "/api/v1/accounts/1/twitter_channels/1/register_webhook", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.RegisterWebhook(c) })
|
|
}
|
|
|
|
func TestTwitterChannelHandler_ListWebhooks_Cov14(t *testing.T) {
|
|
h := NewTwitterChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/twitter_channels/1/webhooks", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.ListWebhooks(c) })
|
|
}
|
|
|
|
func TestTwitterChannelHandler_OAuthCallbackGET_Cov14(t *testing.T) {
|
|
h := NewTwitterChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/twitter/callback", "1")
|
|
safeCall_Cov14(t, func() { h.OAuthCallbackGET(c) })
|
|
}
|
|
|
|
// ============ SSO Session Handler Tests ============
|
|
|
|
func TestSSOSessionHandler_ListByUser_Cov14(t *testing.T) {
|
|
h := NewSSOSessionHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/sso_sessions", "1")
|
|
safeCall_Cov14(t, func() { h.ListByUser(c) })
|
|
}
|
|
|
|
func TestSSOSessionHandler_Get_Cov14(t *testing.T) {
|
|
h := NewSSOSessionHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/sso_sessions/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestSSOSessionHandler_Terminate_Cov14(t *testing.T) {
|
|
h := NewSSOSessionHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/sso_sessions/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Terminate(c) })
|
|
}
|
|
|
|
func TestSSOSessionHandler_TerminateAllByUser_Cov14(t *testing.T) {
|
|
h := NewSSOSessionHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/sso_sessions/all", "1")
|
|
safeCall_Cov14(t, func() { h.TerminateAllByUser(c) })
|
|
}
|
|
|
|
func TestSSOSessionHandler_CountByUser_Cov14(t *testing.T) {
|
|
h := NewSSOSessionHandler(nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/sso_sessions/count", "1")
|
|
safeCall_Cov14(t, func() { h.CountByUser(c) })
|
|
}
|
|
|
|
// ============ LINE Channel Handler Tests ============
|
|
|
|
func TestLineChannelHandler_Create_Cov14(t *testing.T) {
|
|
h := NewLINEChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/line_channels", "1", `{"channel_id":"1"}`)
|
|
safeCall_Cov14(t, func() { h.Create(c) })
|
|
}
|
|
|
|
func TestLineChannelHandler_Get_Cov14(t *testing.T) {
|
|
h := NewLINEChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/line_channels/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Get(c) })
|
|
}
|
|
|
|
func TestLineChannelHandler_Update_Cov14(t *testing.T) {
|
|
h := NewLINEChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/line_channels/1", "1", `{"channel_id":"1"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Update(c) })
|
|
}
|
|
|
|
func TestLineChannelHandler_Delete_Cov14(t *testing.T) {
|
|
h := NewLINEChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/line_channels/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.Delete(c) })
|
|
}
|
|
|
|
func TestLineChannelHandler_List_Cov14(t *testing.T) {
|
|
h := NewLINEChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/line_channels", "1")
|
|
safeCall_Cov14(t, func() { h.List(c) })
|
|
}
|
|
|
|
// ============ TikTok Channel Handler Tests ============
|
|
|
|
func TestTikTokChannelHandler_CreateTikTokChannel_Cov14(t *testing.T) {
|
|
h := NewTikTokChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("POST", "/api/v1/accounts/1/tiktok_channels", "1", `{"tiktok_id":"1"}`)
|
|
safeCall_Cov14(t, func() { h.CreateTikTokChannel(c) })
|
|
}
|
|
|
|
func TestTikTokChannelHandler_GetTikTokChannel_Cov14(t *testing.T) {
|
|
h := NewTikTokChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/tiktok_channels/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.GetTikTokChannel(c) })
|
|
}
|
|
|
|
func TestTikTokChannelHandler_UpdateTikTokChannel_Cov14(t *testing.T) {
|
|
h := NewTikTokChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcctBody_Cov14("PUT", "/api/v1/accounts/1/tiktok_channels/1", "1", `{"tiktok_id":"1"}`)
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.UpdateTikTokChannel(c) })
|
|
}
|
|
|
|
func TestTikTokChannelHandler_DeleteTikTokChannel_Cov14(t *testing.T) {
|
|
h := NewTikTokChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("DELETE", "/api/v1/accounts/1/tiktok_channels/1", "1")
|
|
c.Params = append(c.Params, gin.Param{Key: "id", Value: "1"})
|
|
safeCall_Cov14(t, func() { h.DeleteTikTokChannel(c) })
|
|
}
|
|
|
|
func TestTikTokChannelHandler_ListTikTokChannels_Cov14(t *testing.T) {
|
|
h := NewTikTokChannelHandler(nil, nil, nil, nil)
|
|
c, _ := ctxWithAcct_Cov14("GET", "/api/v1/accounts/1/tiktok_channels", "1")
|
|
safeCall_Cov14(t, func() { h.ListTikTokChannels(c) })
|
|
}
|