## Tests for RoomChest presence and item counts in Floor 2 and Home rooms.
extends GutTest


func test_ultrasound_has_chest_ultrasound_cart() -> void:
	var room: Node = preload("res://scenes/rooms/floor2/Ultrasound.tscn").instantiate()
	add_child_autofree(room)
	assert_not_null(room.get_node_or_null("UltrasoundCart"))


func test_ultrasound_cart_has_three_items() -> void:
	var room: Node = preload("res://scenes/rooms/floor2/Ultrasound.tscn").instantiate()
	add_child_autofree(room)
	var chest: RoomChest = room.get_node_or_null("UltrasoundCart") as RoomChest
	assert_eq(chest.get_item_config_count(), 3)


func test_delivery_room_has_chest_delivery_cabinet() -> void:
	var room: Node = preload("res://scenes/rooms/floor2/DeliveryRoom.tscn").instantiate()
	add_child_autofree(room)
	assert_not_null(room.get_node_or_null("DeliveryCabinet"))


func test_delivery_cabinet_has_three_items() -> void:
	var room: Node = preload("res://scenes/rooms/floor2/DeliveryRoom.tscn").instantiate()
	add_child_autofree(room)
	var chest: RoomChest = room.get_node_or_null("DeliveryCabinet") as RoomChest
	assert_eq(chest.get_item_config_count(), 3)


func test_nursery_has_chest_nursery_shelf() -> void:
	var room: Node = preload("res://scenes/rooms/floor2/Nursery.tscn").instantiate()
	add_child_autofree(room)
	assert_not_null(room.get_node_or_null("NurseryShelf"))


func test_nursery_shelf_has_three_items() -> void:
	var room: Node = preload("res://scenes/rooms/floor2/Nursery.tscn").instantiate()
	add_child_autofree(room)
	var chest: RoomChest = room.get_node_or_null("NurseryShelf") as RoomChest
	assert_eq(chest.get_item_config_count(), 3)


func test_garden_party_has_chest_garden_table() -> void:
	var room: Node = preload("res://scenes/rooms/home/GardenParty.tscn").instantiate()
	add_child_autofree(room)
	assert_not_null(room.get_node_or_null("GardenTable"))


func test_garden_table_has_two_items() -> void:
	var room: Node = preload("res://scenes/rooms/home/GardenParty.tscn").instantiate()
	add_child_autofree(room)
	var chest: RoomChest = room.get_node_or_null("GardenTable") as RoomChest
	assert_eq(chest.get_item_config_count(), 2)


func test_garden_party_has_chest_garden_storage() -> void:
	var room: Node = preload("res://scenes/rooms/home/GardenParty.tscn").instantiate()
	add_child_autofree(room)
	assert_not_null(room.get_node_or_null("GardenStorage"))


func test_garden_storage_has_two_items() -> void:
	var room: Node = preload("res://scenes/rooms/home/GardenParty.tscn").instantiate()
	add_child_autofree(room)
	var chest: RoomChest = room.get_node_or_null("GardenStorage") as RoomChest
	assert_eq(chest.get_item_config_count(), 2)
