101577f163
- Updated import paths in multiple service files to reflect the new agent-desk module. - Added a new configuration file for agent-desk in the Docker setup.
29 lines
698 B
Go
29 lines
698 B
Go
package services
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"agent-desk/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")
|
|
}
|
|
}
|