fix: complete Task 5 visual HUD validation
This commit is contained in:
@@ -211,6 +211,24 @@ func test_dynamic_hud_groups_refresh_from_live_game_values() -> void:
|
||||
assert_string_contains(_combined_label_text(command_hints), "Ouvrir la porte")
|
||||
_assert_controls_enclosed(command_bar, command_hints, "CommandBar")
|
||||
|
||||
func test_compact_1280_layout_scales_header_text_and_keeps_it_inside_the_top_bar() -> void:
|
||||
var hud := game.get_node_or_null("HUD") as GameHud
|
||||
assert_not_null(hud, "Game scene requires HUD")
|
||||
if hud == null:
|
||||
return
|
||||
|
||||
hud.apply_viewport_layout(Vector2(1280, 720))
|
||||
var top_bar := hud.get_node_or_null("ResponsiveLayout/TopBar") as Control
|
||||
var header := hud.get_node_or_null("HeaderValuesLabel") as Label
|
||||
assert_not_null(top_bar, "ResponsiveLayout requires a TopBar")
|
||||
assert_not_null(header, "HUD requires HeaderValuesLabel")
|
||||
if top_bar == null or header == null:
|
||||
return
|
||||
|
||||
assert_eq(header.get_theme_font_size(&"font_size"), 11, "The compact shell scales the 16px header value font to the 1280x720 artboard")
|
||||
assert_true(top_bar.get_global_rect().encloses(header.get_global_rect()), "The compact header remains inside its TopBar")
|
||||
assert_lte(header.get_minimum_size().y, header.size.y, "The compact header has enough height for its scaled text")
|
||||
|
||||
func test_long_deadline_text_wraps_and_stays_inside_the_left_rail() -> void:
|
||||
var hud := game.get_node_or_null("HUD") as GameHud
|
||||
assert_not_null(hud, "Game scene requires HUD")
|
||||
|
||||
Reference in New Issue
Block a user