5d7c10aeab
- Updated runtime configuration to use __CS_AI_AGENT_WIDGET_CONFIG__ instead of __CS_AGENT_WIDGET_CONFIG__. - Changed message types in support host bridge from "cs-agent" to "cs-ai-agent". - Minified SDK script updated to reflect new AI agent naming conventions. - Adjusted scrollbar styles in main.scss to use .cs-ai-agent-scrollbar instead of .cs-agent-scrollbar.
29 lines
699 B
Go
29 lines
699 B
Go
package services
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"cs-ai-agent/internal/pkg/dto/response"
|
|
)
|
|
|
|
func TestWsNotificationTopic(t *testing.T) {
|
|
svc := newWsService()
|
|
if got := svc.notificationTopic(123); got != "notification:123" {
|
|
t.Fatalf("expected notification:123, got %q", got)
|
|
}
|
|
}
|
|
|
|
func TestWsNotificationCreatedEventType(t *testing.T) {
|
|
event := RealtimeNotificationCreatedEvent{
|
|
Payload: RealtimeNotificationCreatedPayload{
|
|
Notification: response.NotificationResponse{ID: 1},
|
|
},
|
|
}
|
|
if got := event.EventType(); got != "notification.created" {
|
|
t.Fatalf("expected notification.created, got %q", got)
|
|
}
|
|
if payload := event.EventPayload(); payload == nil {
|
|
t.Fatalf("expected payload")
|
|
}
|
|
}
|