WIP checkpoint: Address review feedback: Fix: navigating Play -> Back logs the user out (should stay logged in)

This commit is contained in:
2026-08-20 16:47:47 +00:00
parent 00cdab0452
commit e51c4d80b8
2 changed files with 10 additions and 6 deletions
+9 -5
View File
@@ -14,7 +14,7 @@ extends SceneTree
## 3. Click Play -> world_list.tscn.
## 4. Click Back -> main_menu.tscn.
## 5. Assert the menu is STILL authenticated (Play enabled, welcome label
## visible, login/register buttons hidden).
## actually visible in the tree, login/register buttons hidden).
##
## Run with:
## godot --headless --path . --script res://scripts/smoke_test_main_menu_back.gd
@@ -118,14 +118,18 @@ func _is_authenticated(menu: Control) -> bool:
var auth_panel: PanelContainer = menu.get_node("CenterContainer/VBoxContainer/AuthPanel")
_check("Play enabled", not play_button.disabled)
_check("Welcome label visible", welcome_label.visible)
# WelcomeLabel lives inside AuthPanel, so `.visible` alone is a
# false-positive: the label can have visible=true while its parent is
# hidden and it renders as nothing. `is_visible_in_tree()` is the
# check that proves the user can actually see the welcome message.
_check("Welcome label visible in tree", welcome_label.is_visible_in_tree())
_check("Auth buttons row hidden", not auth_buttons_row.visible)
_check("Auth panel hidden", not auth_panel.visible)
_check("Auth panel visible (it contains the welcome label)", auth_panel.visible)
return (not play_button.disabled) \
and welcome_label.visible \
and welcome_label.is_visible_in_tree() \
and not auth_buttons_row.visible \
and not auth_panel.visible
and auth_panel.visible
func _wait_for_scene_change(previous_scene: Node) -> void:
+1 -1
View File
@@ -60,7 +60,7 @@ func _run() -> void:
await instance._on_auth_button_pressed()
_check("Play became enabled after real register submission", not play_button.disabled)
_check("Welcome label visible", welcome_label.visible)
_check("Welcome label visible in tree", welcome_label.is_visible_in_tree())
_check("Auth buttons row hid itself after success", not auth_buttons_row.visible)
print("\n=== SMOKE RESULT: %d/%d passed ===" % [passed, passed + failed])