extends SceneTree ## Verifies the main menu's Login/Register buttons actually open the auth ## panel via a real signal emission (not calling the handler method ## directly) -- that's the exact gap that shipped without ever being ## caught: the AuthPanel and its logic were all correct, but nothing in ## the scene was ever wired to open it. func _initialize() -> void: _run() func _run() -> void: await process_frame var passed := 0 var failed := 0 var packed: PackedScene = load("res://scenes/main_menu.tscn") var instance: Control = packed.instantiate() root.add_child(instance) await process_frame var login_button: Button = instance.get_node("CenterContainer/VBoxContainer/AuthButtonsRow/LoginButton") var register_button: Button = instance.get_node("CenterContainer/VBoxContainer/AuthButtonsRow/RegisterButton") var auth_panel: PanelContainer = instance.get_node("CenterContainer/VBoxContainer/AuthPanel") if _check("auth panel starts hidden", not auth_panel.visible): passed += 1 else: failed += 1 login_button.pressed.emit() await process_frame if _check("auth panel visible after a real LoginButton press signal", auth_panel.visible): passed += 1 else: failed += 1 # Reset and check RegisterButton independently too. auth_panel.visible = false register_button.pressed.emit() await process_frame if _check("auth panel visible after a real RegisterButton press signal", auth_panel.visible): passed += 1 else: failed += 1 print("\n=== SMOKE RESULT: %d/%d passed ===" % [passed, passed + failed]) quit(0 if failed == 0 else 1) func _check(description: String, condition: bool) -> bool: if condition: print(" PASS: ", description) else: printerr(" FAIL: ", description) return condition