mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 17:03:43 +00:00
fix(multiplayer): validate ranked arena paths durably
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package store
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/cosmic-clash/cosmic-clash/server/domain"
|
||||
)
|
||||
|
||||
func TestRankedProposalMatchPlanRequiresRegisteredArenaPath(t *testing.T) {
|
||||
proposal := domain.Proposal{
|
||||
Playlist: domain.Ranked,
|
||||
Region: "EU",
|
||||
Protocol: 1,
|
||||
ArenaPath: "res://scenes/arena_01.tscn",
|
||||
Participants: []domain.ProposalParticipant{
|
||||
{PlayerID: "player-a", Team: 0, Slot: 0},
|
||||
{PlayerID: "player-b", Team: 1, Slot: 3},
|
||||
},
|
||||
}
|
||||
if !validProposalMatchPlan(proposal) {
|
||||
t.Fatal("registered ranked arena rejected")
|
||||
}
|
||||
for _, path := range []string{"", "res://scenes/arena_01_elevated.tscn", "res://forged.tscn"} {
|
||||
proposal.ArenaPath = path
|
||||
if validProposalMatchPlan(proposal) {
|
||||
t.Fatalf("ranked path %q accepted", path)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user