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


func test_reception_has_chest_reception_desk() -> void:
	var room: Node = preload("res://scenes/rooms/floor0/Reception.tscn").instantiate()
	add_child_autofree(room)
	assert_not_null(room.get_node_or_null("ReceptionDesk"))


func test_reception_desk_has_three_items() -> void:
	var room: Node = preload("res://scenes/rooms/floor0/Reception.tscn").instantiate()
	add_child_autofree(room)
	var chest: RoomChest = room.get_node_or_null("ReceptionDesk") as RoomChest
	assert_eq(chest.get_item_config_count(), 3)


func test_giftshop_has_chest_giftshop_shelf() -> void:
	var room: Node = preload("res://scenes/rooms/floor0/GiftShop.tscn").instantiate()
	add_child_autofree(room)
	assert_not_null(room.get_node_or_null("GiftShopShelf"))


func test_giftshop_shelf_has_three_items() -> void:
	var room: Node = preload("res://scenes/rooms/floor0/GiftShop.tscn").instantiate()
	add_child_autofree(room)
	var chest: RoomChest = room.get_node_or_null("GiftShopShelf") as RoomChest
	assert_eq(chest.get_item_config_count(), 3)


func test_restaurant_has_chest_restaurant_counter() -> void:
	var room: Node = preload("res://scenes/rooms/floor0/Restaurant.tscn").instantiate()
	add_child_autofree(room)
	assert_not_null(room.get_node_or_null("RestaurantCounter"))


func test_restaurant_counter_has_three_items() -> void:
	var room: Node = preload("res://scenes/rooms/floor0/Restaurant.tscn").instantiate()
	add_child_autofree(room)
	var chest: RoomChest = room.get_node_or_null("RestaurantCounter") as RoomChest
	assert_eq(chest.get_item_config_count(), 3)


func test_emergency_has_chest_emergency_cabinet() -> void:
	var room: Node = preload("res://scenes/rooms/floor0/EmergencyRoom.tscn").instantiate()
	add_child_autofree(room)
	assert_not_null(room.get_node_or_null("EmergencyCabinet"))


func test_emergency_cabinet_has_three_items() -> void:
	var room: Node = preload("res://scenes/rooms/floor0/EmergencyRoom.tscn").instantiate()
	add_child_autofree(room)
	var chest: RoomChest = room.get_node_or_null("EmergencyCabinet") as RoomChest
	assert_eq(chest.get_item_config_count(), 3)
