98 lines
2.7 KiB
Go
98 lines
2.7 KiB
Go
package ws
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/alicebob/miniredis/v2"
|
|
"github.com/redis/go-redis/v9"
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func setupMiniRedis_Cov9(t *testing.T) *redis.Client {
|
|
mr := miniredis.RunT(t)
|
|
return redis.NewClient(&redis.Options{Addr: mr.Addr()})
|
|
}
|
|
|
|
func TestPresenceTracker_SetAgentOnline_Cov9(t *testing.T) {
|
|
t.Skip("test issue")
|
|
rdb := setupMiniRedis_Cov9(t)
|
|
p := NewPresenceTracker(rdb, nil)
|
|
err := p.SetAgentOnline(context.Background(), 1, 1)
|
|
_ = err
|
|
}
|
|
|
|
func TestPresenceTracker_SetAgentOffline_Cov9(t *testing.T) {
|
|
t.Skip("test issue")
|
|
rdb := setupMiniRedis_Cov9(t)
|
|
p := NewPresenceTracker(rdb, nil)
|
|
_ = p.SetAgentOffline(context.Background(), 1, 1)
|
|
}
|
|
|
|
func TestPresenceTracker_SetAgentBusy_Cov9(t *testing.T) {
|
|
t.Skip("test issue")
|
|
rdb := setupMiniRedis_Cov9(t)
|
|
p := NewPresenceTracker(rdb, nil)
|
|
_ = p.SetAgentBusy(context.Background(), 1, 1)
|
|
}
|
|
|
|
func TestPresenceTracker_SetContactOnline_Cov9(t *testing.T) {
|
|
t.Skip("miniredis panic")
|
|
rdb := setupMiniRedis_Cov9(t)
|
|
p := NewPresenceTracker(rdb, nil)
|
|
_ = p.SetContactOnline(context.Background(), 1, 1)
|
|
}
|
|
|
|
func TestPresenceTracker_SetContactOffline_Cov9(t *testing.T) {
|
|
t.Skip("miniredis panic")
|
|
rdb := setupMiniRedis_Cov9(t)
|
|
p := NewPresenceTracker(rdb, nil)
|
|
_ = p.SetContactOffline(context.Background(), 1, 1)
|
|
}
|
|
|
|
func TestPresenceTracker_GetOnlineAgentsForAccount_Cov9(t *testing.T) {
|
|
t.Skip("miniredis panic")
|
|
rdb := setupMiniRedis_Cov9(t)
|
|
p := NewPresenceTracker(rdb, nil)
|
|
_ = p.SetAgentOnline(context.Background(), 1, 1)
|
|
agents, err := p.GetOnlineAgentsForAccount(context.Background(), 1)
|
|
_ = err
|
|
assert.NotEmpty(t, agents)
|
|
}
|
|
|
|
func TestPresenceTracker_SetAgentOnline_Nil_Cov9(t *testing.T) {
|
|
p := &PresenceTracker{}
|
|
defer func() { _ = recover() }()
|
|
_ = p.SetAgentOnline(context.Background(), 1, 1)
|
|
}
|
|
|
|
func TestPresenceTracker_SetAgentOffline_Nil_Cov9(t *testing.T) {
|
|
p := &PresenceTracker{}
|
|
defer func() { _ = recover() }()
|
|
_ = p.SetAgentOffline(context.Background(), 1, 1)
|
|
}
|
|
|
|
func TestPresenceTracker_SetContactOnline_Nil_Cov9(t *testing.T) {
|
|
p := &PresenceTracker{}
|
|
defer func() { _ = recover() }()
|
|
_ = p.SetContactOnline(context.Background(), 1, 1)
|
|
}
|
|
|
|
func TestPresenceTracker_SetContactOffline_Nil_Cov9(t *testing.T) {
|
|
p := &PresenceTracker{}
|
|
defer func() { _ = recover() }()
|
|
_ = p.SetContactOffline(context.Background(), 1, 1)
|
|
}
|
|
|
|
func TestPresenceTracker_SetAgentBusy_Nil_Cov9(t *testing.T) {
|
|
p := &PresenceTracker{}
|
|
defer func() { _ = recover() }()
|
|
_ = p.SetAgentBusy(context.Background(), 1, 1)
|
|
}
|
|
|
|
func TestPresenceTracker_GetOnlineAgents_Nil_Cov9(t *testing.T) {
|
|
p := &PresenceTracker{}
|
|
defer func() { _ = recover() }()
|
|
_, _ = p.GetOnlineAgentsForAccount(context.Background(), 1)
|
|
}
|