168 lines
3.8 KiB
Go
168 lines
3.8 KiB
Go
package model
|
|
|
|
import (
|
|
"encoding/json"
|
|
"testing"
|
|
"time"
|
|
|
|
"gorm.io/datatypes"
|
|
"gorm.io/gorm"
|
|
)
|
|
|
|
func TestAccount_IncrementEmailSentCount_Cov3(t *testing.T) {
|
|
a := &Account{}
|
|
_ = a.IncrementEmailSentCount(time.Now())
|
|
}
|
|
|
|
func TestDefaultAssistantConfig_Cov3(t *testing.T) {
|
|
m := DefaultAssistantConfig()
|
|
_ = m
|
|
}
|
|
|
|
func TestCaptainAssistant_GetConfig_Cov3(t *testing.T) {
|
|
a := &CaptainAssistant{}
|
|
_, _ = a.GetConfig()
|
|
}
|
|
|
|
func TestCaptainAssistant_SetConfig_Cov3(t *testing.T) {
|
|
a := &CaptainAssistant{}
|
|
_ = a.SetConfig(&AssistantConfig{})
|
|
}
|
|
|
|
func TestCaptainAssistant_GetResponseGuidelines_Cov3(t *testing.T) {
|
|
a := &CaptainAssistant{}
|
|
_, _ = a.GetResponseGuidelines()
|
|
}
|
|
|
|
func TestCaptainAssistant_GetGuardrails_Cov3(t *testing.T) {
|
|
a := &CaptainAssistant{}
|
|
_, _ = a.GetGuardrails()
|
|
}
|
|
|
|
func TestRegisterChannelFactory_Cov3(t *testing.T) {
|
|
RegisterChannelFactory("test_type", func() Channelable { return nil })
|
|
}
|
|
|
|
func TestCopilotMessage_BeforeSave_Cov3(t *testing.T) {
|
|
m := &CopilotMessage{}
|
|
_ = m.BeforeSave(&gorm.DB{})
|
|
}
|
|
|
|
func TestBoolPtr_Cov3(t *testing.T) {
|
|
b := BoolPtr(true)
|
|
if !*b {
|
|
t.Error("expected true")
|
|
}
|
|
}
|
|
|
|
func TestValidateContent_Cov3(t *testing.T) {
|
|
_ = ValidateContent(json.RawMessage(`{"key":"value"}`))
|
|
_ = ValidateContent(json.RawMessage(`invalid`))
|
|
}
|
|
|
|
func TestIsValidHTTPURL_Cov3(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")
|
|
}
|
|
if IsValidHTTPURL("ftp://example.com") {
|
|
t.Error("ftp URL should return false")
|
|
}
|
|
}
|
|
|
|
func TestHookSettingsMap_Value_Cov3(t *testing.T) {
|
|
h := HookSettingsMap{}
|
|
_, _ = h.Value()
|
|
}
|
|
|
|
func TestHookSettingsMap_Scan_Cov3(t *testing.T) {
|
|
h := &HookSettingsMap{}
|
|
_ = h.Scan([]byte(`{"key":"value"}`))
|
|
_ = h.Scan(nil)
|
|
}
|
|
|
|
func TestToDatatypesJSON_Cov3(t *testing.T) {
|
|
m := &JSONMap{"key": "value"}
|
|
_ = ToDatatypesJSON(m)
|
|
}
|
|
|
|
func TestAllEmailFlags_Cov3(t *testing.T) {
|
|
_ = AllEmailFlags()
|
|
}
|
|
|
|
func TestAllPushFlags_Cov3(t *testing.T) {
|
|
_ = AllPushFlags()
|
|
}
|
|
|
|
func TestAllEmailFlagNames_Cov3(t *testing.T) {
|
|
_ = AllEmailFlagNames()
|
|
}
|
|
|
|
func TestAllPushFlagNames_Cov3(t *testing.T) {
|
|
_ = AllPushFlagNames()
|
|
}
|
|
|
|
func TestNotificationSetting_HasEmailFlag_Cov3(t *testing.T) {
|
|
ns := &NotificationSetting{}
|
|
_ = ns.HasEmailFlag(1)
|
|
}
|
|
|
|
func TestNotificationSetting_HasPushFlag_Cov3(t *testing.T) {
|
|
ns := &NotificationSetting{}
|
|
_ = ns.HasPushFlag(1)
|
|
}
|
|
|
|
func TestNotificationSetting_SetEmailFlagsFromNames_Cov3(t *testing.T) {
|
|
ns := &NotificationSetting{}
|
|
ns.SetEmailFlagsFromNames([]string{"conversation_creation"})
|
|
}
|
|
|
|
func TestNotificationSetting_SetPushFlagsFromNames_Cov3(t *testing.T) {
|
|
ns := &NotificationSetting{}
|
|
ns.SetPushFlagsFromNames([]string{"conversation_creation"})
|
|
}
|
|
|
|
func TestNotificationSetting_SelectedEmailFlagNames_Cov3(t *testing.T) {
|
|
ns := &NotificationSetting{}
|
|
_ = ns.SelectedEmailFlagNames()
|
|
}
|
|
|
|
func TestNotificationSetting_SelectedPushFlagNames_Cov3(t *testing.T) {
|
|
ns := &NotificationSetting{}
|
|
_ = ns.SelectedPushFlagNames()
|
|
}
|
|
|
|
func TestNotificationSubscriptionType_String_Cov3(t *testing.T) {
|
|
_ = NotificationSubscriptionType(1).String()
|
|
}
|
|
|
|
func TestNotificationSubscriptionTypeFromString_Cov3(t *testing.T) {
|
|
_ = NotificationSubscriptionTypeFromString("all")
|
|
_ = NotificationSubscriptionTypeFromString("invalid")
|
|
}
|
|
|
|
func TestPlatformApp_IsActive_Cov3(t *testing.T) {
|
|
a := &PlatformApp{}
|
|
_ = a.IsActive()
|
|
}
|
|
|
|
func TestSSOSession_IsActive_Cov3(t *testing.T) {
|
|
s := &SSOSession{}
|
|
_ = s.IsActive()
|
|
}
|
|
|
|
func TestWebhookSubscription_IsEventSubscribed_Cov3(t *testing.T) {
|
|
wh := &WebhookSubscription{}
|
|
_ = wh.IsEventSubscribed("message_created")
|
|
}
|
|
|
|
func TestWorkingHour_Validate_Cov3(t *testing.T) {
|
|
wh := &WorkingHour{}
|
|
_ = wh.Validate()
|
|
}
|
|
|
|
// Keep datatypes import used
|
|
var _ = datatypes.JSON{}
|