mirror of
https://github.com/jcreek/CosmicClash.git
synced 2026-09-11 08:23:45 +00:00
feat(multiplayer): persist ranked arena allocations
This commit is contained in:
@@ -59,6 +59,19 @@ func TestAcceptedMatchPromotionHonoursPlaylistSizeInvariant(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRankedAcceptedMatchPlanRequiresArenaAfterPlaylistResolution(t *testing.T) {
|
||||
plan := AcceptedMatchPlan{MatchID: "match-1", ProposalID: "proposal-1", Region: "EU", Protocol: 1, Players: []MatchPlayer{{PlayerID: "player-a", Team: 0, Slot: 0}, {PlayerID: "player-b", Team: 1, Slot: 3}}}
|
||||
if !validAcceptedMatchPlan(plan) {
|
||||
t.Fatal("test plan should reach the database playlist guard")
|
||||
}
|
||||
// CreateMatchFromAcceptedProposal owns the playlist lookup, so a nil DB is
|
||||
// the only no-database check available here; the integration suite exercises
|
||||
// the resolved ranked branch against PostgreSQL.
|
||||
if err := CreateMatchFromAcceptedProposal(nil, nil, plan, time.Now()); err == nil {
|
||||
t.Fatal("nil database accepted")
|
||||
}
|
||||
}
|
||||
|
||||
func TestMatchPlayersFromTeamsUsesDeterministicTeamSlots(t *testing.T) {
|
||||
teams := domain.Teams{
|
||||
Team0: []domain.Candidate{{PlayerID: "bravo"}, {PlayerID: "alpha"}},
|
||||
|
||||
Reference in New Issue
Block a user