fix(multiplayer): project complete queue lifecycle

This commit is contained in:
Josh Creek
2026-09-01 21:55:19 +01:00
parent 6ac2d0fbb1
commit 30a5a89164
5 changed files with 32 additions and 4 deletions
@@ -19,6 +19,15 @@ func test_ticket_projection_accepts_authoritative_accepted_phase() -> void:
assert_true(not state.can_cancel(), "accepted match cannot be cancelled as a queue ticket")
func test_ticket_projection_accepts_post_match_lifecycle_states() -> void:
for phase in ["ASSIGNED", "CONNECTING", "LIVE", "RESULT_PENDING", "COMPLETED"]:
var state := MatchmakingState.new()
assert_true(state.begin_queue("ticket-" + phase, "casual"), "queue setup succeeds for " + phase)
assert_true(state.apply_ticket_update({"ticket_id": "ticket-" + phase, "revision": 1, "state": phase, "playlist": "casual"}), "post-match phase is valid: " + phase)
assert_eq(state.phase, phase, "post-match phase remains visible: " + phase)
assert_true(not state.can_cancel(), "post-match phase cannot cancel: " + phase)
func test_ticket_projection_rejects_gap_and_wrong_ticket_without_mutation() -> void:
var state := MatchmakingState.new()
assert_true(state.begin_queue("ticket-1", "casual"), "queue setup succeeds")