Files
ai-agent/internal/services/ws_service_test.go
T
t 2bbf42b741 refactor(auth): delegate access control to be-system
Remove Agent Desk users, roles, login sessions, tokens, and local permission persistence. Expose the backend as an embeddable ai-agent module with host-provided subject lookup and operation authorization callbacks, and complete the frontend/backend repository split.
2026-08-21 00:41:07 +08:00

29 lines
717 B
Go

package services
import (
"testing"
"code.tczkiot.com/wlw/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")
}
}