mirror of
https://git.boos.lat/aibo/BossChat.git
synced 2026-10-30 15:16:11 +00:00
0f40930a41
- Rename Go module: cs-agent → bosschat - Rename all import paths across 200+ Go files - Rename SDK: cs-ai-agent-sdk → bosschat-sdk - Rename message protocol: cs-agent:* → bosschat:* - Rename JS globals: CSAgentConfig → BossChatConfig - Rename CSS classes: cs-agent-* → bosschat-* - Update Makefile APP_NAME and ARCHIVE_NAME - Update logo assets - Fix display name: BoosChat → BossChat
29 lines
696 B
Go
29 lines
696 B
Go
package services
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"bosschat/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")
|
|
}
|
|
}
|