43 lines
1.1 KiB
Go
43 lines
1.1 KiB
Go
package ws
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
// --- EventPublisher tests ---
|
|
|
|
func TestNewEventPublisher_Cov2(t *testing.T) {
|
|
p := NewEventPublisher(nil, nil, nil)
|
|
assert.NotNil(t, p)
|
|
}
|
|
|
|
func TestNewEventPublisherLocal_Cov2(t *testing.T) {
|
|
p := NewEventPublisherLocal(nil, nil)
|
|
assert.NotNil(t, p)
|
|
}
|
|
|
|
func TestEventPublisher_PublishEvent_NilDeps_Cov2(t *testing.T) {
|
|
p := NewEventPublisherLocal(nil, nil)
|
|
// Should not panic with nil deps
|
|
p.PublishEvent(1, "message_created", map[string]interface{}{"id": 1})
|
|
}
|
|
|
|
func TestEventPublisher_PublishConversationEvent_NilDeps_Cov2(t *testing.T) {
|
|
p := NewEventPublisherLocal(nil, nil)
|
|
p.PublishConversationEvent(1, 1, "message_created", map[string]interface{}{"id": 1})
|
|
}
|
|
|
|
func TestEventPublisher_PublishWidgetEvent_NilDeps_Cov2(t *testing.T) {
|
|
p := NewEventPublisherLocal(nil, nil)
|
|
p.PublishWidgetEvent(1, "widget_token", "message_created", map[string]interface{}{"id": 1})
|
|
}
|
|
|
|
// --- SSERegistry tests ---
|
|
|
|
func TestNewSSERegistry_Cov2(t *testing.T) {
|
|
r := NewSSERegistry()
|
|
assert.NotNil(t, r)
|
|
}
|