feat: add matchmaking queue UI

This commit is contained in:
Josh Creek
2026-08-31 22:39:29 +01:00
parent 5106ac64da
commit 47550aefae
7 changed files with 288 additions and 1 deletions
+18
View File
@@ -0,0 +1,18 @@
extends "res://tests/test_case.gd"
const Matchmaking = preload("res://scripts/matchmaking.gd")
const MatchmakingState = preload("res://scripts/matchmaking_state.gd")
func test_every_backend_phase_has_a_nonempty_user_message() -> void:
for phase in [MatchmakingState.IDLE, MatchmakingState.QUEUED, MatchmakingState.PROPOSED, MatchmakingState.ALLOCATING, MatchmakingState.PROCESS_READY, MatchmakingState.ASSIGNMENT_READY, MatchmakingState.CONNECTING, MatchmakingState.LIVE, MatchmakingState.CANCELLED, MatchmakingState.EXPIRED, MatchmakingState.FAILED]:
assert_true(not Matchmaking.phase_label(phase).is_empty(), "phase %s has visible copy" % phase)
func test_terminal_state_policy_does_not_leave_cancel_or_proposal_actions_enabled() -> void:
for phase in [MatchmakingState.CANCELLED, MatchmakingState.EXPIRED, MatchmakingState.FAILED, MatchmakingState.LIVE]:
assert_true(Matchmaking._is_terminal(phase), "phase %s is terminal" % phase)
assert_true(not Matchmaking._is_terminal(MatchmakingState.QUEUED), "queued search remains active")
assert_true(not Matchmaking._is_terminal(MatchmakingState.PROPOSED), "proposal remains actionable")
assert_true(Matchmaking._can_start_new_search(MatchmakingState.FAILED), "failed search can be retried")
assert_true(not Matchmaking._can_start_new_search(MatchmakingState.LIVE), "live match cannot start a second search")
@@ -78,6 +78,12 @@ func test_required_autoloads_are_registered() -> void:
)
func test_matchmaking_scene_is_the_control_plane_entry_point() -> void:
var scene := load("res://scenes/matchmaking.tscn")
assert_true(scene != null, "matchmaking scene exists")
assert_true(FileAccess.file_exists("res://scripts/matchmaking.gd"), "matchmaking controller exists")
func test_test_hook_autoloads_are_not_shipped() -> void:
# main_menu_test_hooks / lobby_test_hooks are added to [autoload] by hand
# when running those scene-level smoke tests, and must be removed again —