Files
DungeonCrawlerWorld/tests/unit/test_loot_panel_layout.gd

17 lines
712 B
GDScript

extends GutTest
const LootPanelScene = preload("res://scenes/ui/LootPanel.tscn")
func test_chest_title_entries_and_action_have_distinct_layout_zones() -> void:
var panel := LootPanelScene.instantiate() as LootPanel
add_child_autofree(panel)
panel.visible = true
await get_tree().process_frame
var title := panel.get_node("Layout/Title") as Control
var entries := panel.get_node("Layout/Entries") as Control
var take_all := panel.get_node("Layout/TakeAll") as Control
assert_false(title.get_global_rect().intersects(entries.get_global_rect()))
assert_false(title.get_global_rect().intersects(take_all.get_global_rect()))
assert_false(entries.get_global_rect().intersects(take_all.get_global_rect()))