test(scenes): ✅ Add assertions to verify theme data loads correctly in CultureTreeProof scene tests
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
e508b2a726
commit
9a4658faa0
2 changed files with 17 additions and 4 deletions
|
|
@ -81,6 +81,11 @@ func _ready() -> void:
|
|||
await get_tree().create_timer(1.5).timeout
|
||||
elif _scene == "culture_tree_proof":
|
||||
await get_tree().create_timer(0.5).timeout
|
||||
# DataLoader.load_theme must run before the proof scene constructs
|
||||
# its CultureWeb — without it `get_all_culture()` is empty and the
|
||||
# tree renders blank.
|
||||
if DataLoader.get_all_culture().is_empty():
|
||||
DataLoader.load_theme("age-of-dwarves")
|
||||
get_tree().change_scene_to_file(
|
||||
"res://engine/scenes/tests/culture_tree_proof.tscn"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -25,6 +25,11 @@ func _ready() -> void:
|
|||
if not env_name.is_empty():
|
||||
_screenshot_name = env_name
|
||||
|
||||
# Required by every proof scene — without it DataLoader has no data and
|
||||
# both `get_all_culture()` and `get_all_techs()` come back empty,
|
||||
# leaving the rendered tree blank.
|
||||
DataLoader.load_theme("age-of-dwarves")
|
||||
|
||||
await get_tree().process_frame
|
||||
_setup_game_state()
|
||||
_show_culture_tree()
|
||||
|
|
@ -40,10 +45,13 @@ func _setup_game_state() -> void:
|
|||
"num_players": 1,
|
||||
})
|
||||
var player: RefCounted = GameState.create_player("Dwarf King", "dwarf")
|
||||
(player as PlayerScript).add_tradition("ancestor_song")
|
||||
(player as PlayerScript).add_tradition("clan_chronicle")
|
||||
(player as PlayerScript).researching_tradition = "rite_of_remembering"
|
||||
(player as PlayerScript).culture_research_progress = 12
|
||||
# Real tradition ids from public/resources/culture/*.json. Two T1 picks
|
||||
# already done; mid-research on a T2 entry so the progress bar is
|
||||
# visible on its card.
|
||||
(player as PlayerScript).add_tradition("ancestor_veneration")
|
||||
(player as PlayerScript).add_tradition("oral_tradition")
|
||||
(player as PlayerScript).researching_tradition = "epic_poetry"
|
||||
(player as PlayerScript).culture_research_progress = 14 # cost 35 → ~40 %
|
||||
GameState.current_player_index = 0
|
||||
|
||||
var cw: CultureWebScript = TurnManager.get_culture_web()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue