WIP checkpoint: Address review feedback: Fix: navigating Play -> Back logs the user out (should stay logged in)
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user