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


func test_xray_has_chest_xray_cabinet() -> void:
	var room: Node = preload("res://scenes/rooms/floor1/XRay.tscn").instantiate()
	add_child_autofree(room)
	assert_not_null(room.get_node_or_null("XRayCabinet"))


func test_xray_cabinet_has_three_items() -> void:
	var room: Node = preload("res://scenes/rooms/floor1/XRay.tscn").instantiate()
	add_child_autofree(room)
	var chest: RoomChest = room.get_node_or_null("XRayCabinet") as RoomChest
	assert_eq(chest.get_item_config_count(), 3)


func test_pharmacy_has_chest_pharmacy_medicine() -> void:
	var room: Node = preload("res://scenes/rooms/floor1/Pharmacy.tscn").instantiate()
	add_child_autofree(room)
	assert_not_null(room.get_node_or_null("PharmacyMedicine"))


func test_pharmacy_medicine_has_two_items() -> void:
	var room: Node = preload("res://scenes/rooms/floor1/Pharmacy.tscn").instantiate()
	add_child_autofree(room)
	var chest: RoomChest = room.get_node_or_null("PharmacyMedicine") as RoomChest
	assert_eq(chest.get_item_config_count(), 2)


func test_pharmacy_has_chest_pharmacy_tools() -> void:
	var room: Node = preload("res://scenes/rooms/floor1/Pharmacy.tscn").instantiate()
	add_child_autofree(room)
	assert_not_null(room.get_node_or_null("PharmacyTools"))


func test_pharmacy_tools_has_two_items() -> void:
	var room: Node = preload("res://scenes/rooms/floor1/Pharmacy.tscn").instantiate()
	add_child_autofree(room)
	var chest: RoomChest = room.get_node_or_null("PharmacyTools") as RoomChest
	assert_eq(chest.get_item_config_count(), 2)


func test_lab_has_chest_lab_bench() -> void:
	var room: Node = preload("res://scenes/rooms/floor1/Lab.tscn").instantiate()
	add_child_autofree(room)
	assert_not_null(room.get_node_or_null("LabBench"))


func test_lab_bench_has_three_items() -> void:
	var room: Node = preload("res://scenes/rooms/floor1/Lab.tscn").instantiate()
	add_child_autofree(room)
	var chest: RoomChest = room.get_node_or_null("LabBench") as RoomChest
	assert_eq(chest.get_item_config_count(), 3)


func test_patient_room_has_chest_patient_cabinet() -> void:
	var room: Node = preload("res://scenes/rooms/floor1/PatientRoom.tscn").instantiate()
	add_child_autofree(room)
	assert_not_null(room.get_node_or_null("PatientCabinet"))


func test_patient_cabinet_has_three_items() -> void:
	var room: Node = preload("res://scenes/rooms/floor1/PatientRoom.tscn").instantiate()
	add_child_autofree(room)
	var chest: RoomChest = room.get_node_or_null("PatientCabinet") as RoomChest
	assert_eq(chest.get_item_config_count(), 3)
