45 lines
1.2 KiB
Go
45 lines
1.2 KiB
Go
package automation
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestInboxChannelConfigString_Cov10(t *testing.T) {
|
|
assert.Equal(t, "", inboxChannelConfigString("", "key"))
|
|
assert.Equal(t, "", inboxChannelConfigString("{}", "key"))
|
|
assert.Equal(t, "val", inboxChannelConfigString(`{"key":"val"}`, "key"))
|
|
}
|
|
|
|
func TestStringList_Cov10(t *testing.T) {
|
|
assert.Empty(t, stringList(nil))
|
|
assert.Equal(t, []string{"a", "b"}, stringList([]any{"a", "b"}))
|
|
}
|
|
|
|
func TestLabelSet_Cov10(t *testing.T) {
|
|
s := labelSet("a,b,c")
|
|
assert.Contains(t, s, "a")
|
|
assert.Contains(t, s, "b")
|
|
assert.Contains(t, s, "c")
|
|
}
|
|
|
|
func TestCsatSurveyService_GetPublicSurvey_Nil_Cov10(t *testing.T) {
|
|
s := &CsatSurveyService{}
|
|
defer func() { _ = recover() }()
|
|
_, _ = s.GetPublicSurveyByConversationUUID(context.Background(), "test-uuid")
|
|
}
|
|
|
|
func TestCsatSurveyService_Update_Nil_Cov10(t *testing.T) {
|
|
s := &CsatSurveyService{}
|
|
defer func() { _ = recover() }()
|
|
_, _ = s.Update(context.Background(), 1, 5, "feedback", "notes")
|
|
}
|
|
|
|
func TestMacroService_UpdateForAccount_Nil_Cov10(t *testing.T) {
|
|
s := &MacroService{}
|
|
defer func() { _ = recover() }()
|
|
_, _ = s.UpdateForAccount(context.Background(), 1, nil)
|
|
}
|