feat(notification): add dashboard notification center
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"cs-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")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user