173 lines
3.9 KiB
Go
173 lines
3.9 KiB
Go
package model
|
|
|
|
import (
|
|
"encoding/json"
|
|
"testing"
|
|
"time"
|
|
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
func TestWorkingHour_EnsureOpenAllDayHours_Cov4(t *testing.T) {
|
|
wh := &WorkingHour{}
|
|
wh.EnsureOpenAllDayHours()
|
|
}
|
|
|
|
func TestCopilotMessage_BeforeSave_Cov4(t *testing.T) {
|
|
m := &CopilotMessage{}
|
|
_ = m.BeforeSave(&gorm.DB{})
|
|
}
|
|
|
|
func TestValidateContent_Valid_Cov4(t *testing.T) {
|
|
_ = ValidateContent(json.RawMessage(`{"key":"value"}`))
|
|
}
|
|
|
|
func TestValidateContent_Invalid_Cov4(t *testing.T) {
|
|
_ = ValidateContent(json.RawMessage(`invalid`))
|
|
}
|
|
|
|
func TestCaptainAutoReplyRule_GetConditions_Cov4(t *testing.T) {
|
|
r := &CaptainAutoReplyRule{}
|
|
_, _ = r.GetConditions()
|
|
}
|
|
|
|
func TestCaptainAssistant_GetConfig_Cov4(t *testing.T) {
|
|
a := &CaptainAssistant{}
|
|
_, _ = a.GetConfig()
|
|
}
|
|
|
|
func TestCaptainAssistant_SetConfig_Cov4(t *testing.T) {
|
|
a := &CaptainAssistant{}
|
|
_ = a.SetConfig(&AssistantConfig{})
|
|
}
|
|
|
|
func TestCaptainAssistant_GetResponseGuidelines_Cov4(t *testing.T) {
|
|
a := &CaptainAssistant{}
|
|
_, _ = a.GetResponseGuidelines()
|
|
}
|
|
|
|
func TestCaptainAssistant_GetGuardrails_Cov4(t *testing.T) {
|
|
a := &CaptainAssistant{}
|
|
_, _ = a.GetGuardrails()
|
|
}
|
|
|
|
func TestAccount_IncrementEmailSentCount_Cov4(t *testing.T) {
|
|
a := &Account{}
|
|
_ = a.IncrementEmailSentCount(time.Now())
|
|
}
|
|
|
|
func TestDefaultAssistantConfig_Cov4(t *testing.T) {
|
|
_ = DefaultAssistantConfig()
|
|
}
|
|
|
|
func TestRegisterChannelFactory_Cov4(t *testing.T) {
|
|
RegisterChannelFactory("test_cov4", func() Channelable { return nil })
|
|
}
|
|
|
|
func TestBoolPtr_Cov4(t *testing.T) {
|
|
b := BoolPtr(true)
|
|
if !*b {
|
|
t.Error("expected true")
|
|
}
|
|
}
|
|
|
|
func TestIsValidHTTPURL_Cov4(t *testing.T) {
|
|
if !IsValidHTTPURL("https://example.com") {
|
|
t.Error("valid URL should return true")
|
|
}
|
|
if IsValidHTTPURL("not-a-url") {
|
|
t.Error("invalid URL should return false")
|
|
}
|
|
}
|
|
|
|
func TestHookSettingsMap_Value_Cov4(t *testing.T) {
|
|
h := HookSettingsMap{}
|
|
_, _ = h.Value()
|
|
}
|
|
|
|
func TestHookSettingsMap_Scan_Cov4(t *testing.T) {
|
|
h := &HookSettingsMap{}
|
|
_ = h.Scan([]byte(`{"key":"value"}`))
|
|
_ = h.Scan(nil)
|
|
}
|
|
|
|
func TestToDatatypesJSON_Cov4(t *testing.T) {
|
|
m := &JSONMap{"key": "value"}
|
|
_ = ToDatatypesJSON(m)
|
|
}
|
|
|
|
func TestAllEmailFlags_Cov4(t *testing.T) {
|
|
_ = AllEmailFlags()
|
|
}
|
|
|
|
func TestAllPushFlags_Cov4(t *testing.T) {
|
|
_ = AllPushFlags()
|
|
}
|
|
|
|
func TestAllEmailFlagNames_Cov4(t *testing.T) {
|
|
_ = AllEmailFlagNames()
|
|
}
|
|
|
|
func TestAllPushFlagNames_Cov4(t *testing.T) {
|
|
_ = AllPushFlagNames()
|
|
}
|
|
|
|
func TestNotificationSetting_HasEmailFlag_Cov4(t *testing.T) {
|
|
ns := &NotificationSetting{}
|
|
_ = ns.HasEmailFlag(1)
|
|
}
|
|
|
|
func TestNotificationSetting_HasPushFlag_Cov4(t *testing.T) {
|
|
ns := &NotificationSetting{}
|
|
_ = ns.HasPushFlag(1)
|
|
}
|
|
|
|
func TestNotificationSetting_SetEmailFlagsFromNames_Cov4(t *testing.T) {
|
|
ns := &NotificationSetting{}
|
|
ns.SetEmailFlagsFromNames([]string{"conversation_creation"})
|
|
}
|
|
|
|
func TestNotificationSetting_SetPushFlagsFromNames_Cov4(t *testing.T) {
|
|
ns := &NotificationSetting{}
|
|
ns.SetPushFlagsFromNames([]string{"conversation_creation"})
|
|
}
|
|
|
|
func TestNotificationSetting_SelectedEmailFlagNames_Cov4(t *testing.T) {
|
|
ns := &NotificationSetting{}
|
|
_ = ns.SelectedEmailFlagNames()
|
|
}
|
|
|
|
func TestNotificationSetting_SelectedPushFlagNames_Cov4(t *testing.T) {
|
|
ns := &NotificationSetting{}
|
|
_ = ns.SelectedPushFlagNames()
|
|
}
|
|
|
|
func TestNotificationSubscriptionType_String_Cov4(t *testing.T) {
|
|
_ = NotificationSubscriptionType(1).String()
|
|
}
|
|
|
|
func TestNotificationSubscriptionTypeFromString_Cov4(t *testing.T) {
|
|
_ = NotificationSubscriptionTypeFromString("all")
|
|
_ = NotificationSubscriptionTypeFromString("invalid")
|
|
}
|
|
|
|
func TestPlatformApp_IsActive_Cov4(t *testing.T) {
|
|
a := &PlatformApp{}
|
|
_ = a.IsActive()
|
|
}
|
|
|
|
func TestSSOSession_IsActive_Cov4(t *testing.T) {
|
|
s := &SSOSession{}
|
|
_ = s.IsActive()
|
|
}
|
|
|
|
func TestWebhookSubscription_IsEventSubscribed_Cov4(t *testing.T) {
|
|
wh := &WebhookSubscription{}
|
|
_ = wh.IsEventSubscribed("message_created")
|
|
}
|
|
|
|
func TestWorkingHour_Validate_Cov4(t *testing.T) {
|
|
wh := &WorkingHour{}
|
|
_ = wh.Validate()
|
|
}
|