20 lines
650 B
Go
20 lines
650 B
Go
package domain
|
|
|
|
import "testing"
|
|
|
|
func TestCopyGamePluginRuntimeProfilesCopiesLogEvents(t *testing.T) {
|
|
profiles := GamePluginRuntimeProfiles{
|
|
LogEvents: []RuntimeLogEvent{{
|
|
Key: "chat-message", Title: "Chat message", SourceKey: "chat-log", EventType: "chat.message",
|
|
Permission: "server.logs.read", SchemaRef: "schemas/log-events/chat-message.schema.json", RetentionDays: 30, Severity: "info",
|
|
}},
|
|
}
|
|
|
|
copied := CopyGamePluginRuntimeProfiles(profiles)
|
|
copied.LogEvents[0].Title = "Mutated"
|
|
|
|
if profiles.LogEvents[0].Title != "Chat message" {
|
|
t.Fatalf("expected log event declarations to be copied, got %+v", profiles.LogEvents)
|
|
}
|
|
}
|