mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-10 16:04:04 +00:00
30 lines
757 B
Go
30 lines
757 B
Go
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)
|
|
}
|
|
}
|
|
}
|