Files
TheTree_mock/tests/ui/test_p08_normal_placement_ops.gd
T
TakeshiandClaude Opus 5.5 83b170a4c7 Fix regressions in roster-only suites from A06/A07/P14-03
The formal collector's roster includes 46 suites the Makefile never ran;
the first formal attempt stopped on test_required_kitchen and a sweep found:
- v15 MIMI purchase saves could not be written once Runtime saves carried
  mana_reserve (P06-01): the format detector now validates that section and
  excludes it before the unchanged v15 allowlist, like special_peeping_rooms.
- test_required_kitchen's legacy14 exact-load comparison now maps the two
  approved migrations (fresh A06 reserve at the restored boundary, elevator
  snapshot v1->v2) after checking each against its contract, in Runtime key
  order; every other byte must still match.
- test_runtime_defense_autonomy allowed Mana to change only by the A06 flow.
- test_p08_normal_placement_ops expects 25 palette slots (two warps); its
  suite-policy pin is updated with flags unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 17:08:40 +09:00

50 lines
2.4 KiB
GDScript

extends SceneTree
const Placement := preload("res://tests/fixtures/p08-03/placement.gd")
class PalettePlacement extends Placement:
func setup() -> void:
super.setup()
await frames()
var palette := main.find_child("BuildPalette", true, false) as GridContainer
expect(palette != null, "production facility palette exists")
if palette == null:
return
expect(palette.get_child_count() == 25 and palette.columns == 25,
"palette has exactly 25 facility slots (A07/A08 warps added)")
expect(main.build_buttons.size() == 25, "all 25 registered facility buttons exist")
for child: Node in palette.get_children():
expect(child is Button and main.build_buttons.values().has(child),
"every palette child is a registered facility button")
for id: StringName in main.MVP_FACILITY_IDS:
expect(main.build_buttons.has(id) and main.build_buttons[id].get_parent() == palette,
"each facility remains inside the facility palette")
var row := palette.get_parent()
expect(row is HBoxContainer and row.get_parent() == main.palette_scroll
and main.palette_scroll.get_child_count() == 1,
"one HBox is the normal palette scroll content")
var demolition: Button = main.demolition_button
expect(demolition != null and demolition.get_parent() == row
and demolition.name == "DemolitionButton" and row.get_child_count() == 2,
"normal demolition entry is a sibling of the facility palette")
if demolition == null:
return
await button(main.palette_toggle_button)
expect(main.palette_scroll.visible and demolition.is_visible_in_tree()
and not demolition.disabled and demolition.toggle_mode,
"opening the normal palette exposes the available demolition entry")
await reveal(demolition)
expect(demolition.get_global_rect().intersects(main.palette_scroll.get_global_rect()),
"demolition entry is reachable through normal palette scrolling")
await button(main.palette_toggle_button)
func _initialize() -> void:
call_deferred("run")
func run() -> void:
var directory := OS.get_environment("P08_PLACEMENT_ROOT")
var role := OS.get_environment("P08_PLACEMENT_ROLE")
if directory.is_empty():
directory = ProjectSettings.globalize_path("user://p08-placement-%d" % Time.get_ticks_usec())
role = "standalone"
var result: Dictionary = await PalettePlacement.new().run(self, directory, role)
print("P08 normal placement: %d checks, %d failures" % [result.checks, result.failures])
quit(0 if result.failures == 0 else 1)