test(client): align sprint 17 tests with implementation (#263, #537)

Fix test API mismatches: time display tests target InsertOverlay/
TimeDisplay and time_display.gd; E-Talk tests rewritten to target
interaction_list.gd _cache_entity_relationship() and _relationship_color
state. Phase 2 tests (name, tier hint) marked as skip placeholders.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-24 11:22:39 +01:00
co-authored by Claude Opus 4.6
parent 2c15ad65e1
commit d8eb256dad
2 changed files with 193 additions and 366 deletions
+6 -6
View File
@@ -5,9 +5,9 @@
## D-031 (game time: 10 ticks = 1 game-minute, 1440 min/day, HH:MM display)
## D-051 (diegetic insert display)
##
## Implementation: client/ui/insert_clock.gd — draw-based Control at UILayer/InsertClock.
## Implementation: client/ui/time_display.gd — draw-based Control at InsertOverlay/TimeDisplay.
## Format function: Constants.format_game_time(time_of_day: int) -> String (extracted for
## testability from insert_clock.gd:43 inline `"%02d:%02d" % [tod/60, tod%60]`).
## testability from time_display.gd:46 inline Constants.format_game_time(tod)).
class_name TestTimeDisplaySprint17
extends GdUnitTestSuite
@@ -17,7 +17,7 @@ var _clock: Control = null
func before_test() -> void:
SimBridge.reset_test_state()
GameState.game_time = {}
var ClockScript = load("res://ui/insert_clock.gd")
var ClockScript = load("res://ui/time_display.gd")
_clock = Control.new()
_clock.set_script(ClockScript)
add_child(_clock)
@@ -260,7 +260,7 @@ func test_sim_bridge_day_phase_is_valid() -> void:
# -------------------------------------------------------------------------
# Scene: InsertClock node at UILayer/InsertClock
# Scene: InsertClock node at InsertOverlay/TimeDisplay
# -------------------------------------------------------------------------
func test_insert_clock_exists_in_ui_layer() -> void:
@@ -269,7 +269,7 @@ func test_insert_clock_exists_in_ui_layer() -> void:
auto_free(instance)
add_child(instance)
assert_that(instance.get_node_or_null("UILayer/InsertClock")).is_not_null()
assert_that(instance.get_node_or_null("InsertOverlay/TimeDisplay")).is_not_null()
func test_insert_clock_time_str_updates_after_process() -> void:
var scene := load("res://scenes/main.tscn")
@@ -283,7 +283,7 @@ func test_insert_clock_time_str_updates_after_process() -> void:
})
instance._process(0.016)
var clock = instance.get_node_or_null("UILayer/InsertClock")
var clock = instance.get_node_or_null("InsertOverlay/TimeDisplay")
assert_that(clock).is_not_null()
assert_that(clock._time_str).is_equal("12:00")