test: align HUD location contract with authored rooms
This commit is contained in:
@@ -34,6 +34,10 @@ Visual capture passed:
|
||||
|
||||
No test, parse, script, or visual-check failures were found. Standard pre-existing GUT invalid-UID and Godot cleanup/resource warnings were emitted, but the verifier accepted them and exited 0.
|
||||
|
||||
## Fix round 1 — Task 3 review
|
||||
|
||||
The dynamic HUD layout contract now derives the expected location id from the authored `floor_state.rooms` bounds before checking the live header text. This avoids calling `room_at()` on surface corridor cells whose map room id is intentionally absent, without changing SurfaceGenerator, HUD, or domain behavior.
|
||||
|
||||
## Git
|
||||
|
||||
This report and only the PR-3 tourist implementation/tests are committed locally in one commit. No push or pull request was created.
|
||||
|
||||
@@ -191,9 +191,15 @@ func test_dynamic_hud_groups_refresh_from_live_game_values() -> void:
|
||||
|
||||
var header_text := _combined_label_text(header_values)
|
||||
var character_text := _combined_label_text(character_values)
|
||||
var expected_room_id := ""
|
||||
for room: RoomState in state.floor_state.rooms:
|
||||
if room.bounds.has_point(state.player.cell):
|
||||
expected_room_id = String(room.id)
|
||||
break
|
||||
assert_ne(expected_room_id, "", "The player's authored room must be discoverable from its bounds")
|
||||
assert_string_contains(header_text, run.player_name)
|
||||
assert_string_contains(header_text, str(state.floor_state.floor_number))
|
||||
assert_string_contains(header_text, String(state.floor_state.room_at(state.player.cell).id))
|
||||
assert_string_contains(header_text, expected_room_id)
|
||||
assert_string_contains(header_text, str(state.explored_cells.size()))
|
||||
assert_string_contains(character_text, str(state.player.hit_points))
|
||||
_assert_controls_enclosed(top_bar, header_values, "TopBar")
|
||||
|
||||
Reference in New Issue
Block a user