test: align storage validation with home upgrades
This commit is contained in:
parent
ff78710303
commit
9cf0c8fc9c
1 changed files with 9 additions and 8 deletions
|
|
@ -24,10 +24,12 @@ func _run() -> void:
|
|||
var bag := PlayerBag.new()
|
||||
var catches := FishInventory.new()
|
||||
var capacity := PlayerCoolerCapacity.new()
|
||||
var home_state := PlayerHomeState.new()
|
||||
var layout := PlayerInventoryLayout.new()
|
||||
var hotbar := PlayerHotbar.new()
|
||||
for node: Node in [bag, catches, capacity, layout, hotbar]:
|
||||
for node: Node in [bag, catches, capacity, home_state, layout, hotbar]:
|
||||
scene_root.add_child(node)
|
||||
capacity.bind_home_state(home_state)
|
||||
bag.setup(ItemCatalogResource)
|
||||
layout.setup(bag, catches, ItemCatalogResource, capacity)
|
||||
bag.set_inventory_layout(layout)
|
||||
|
|
@ -239,13 +241,12 @@ func _run() -> void:
|
|||
(all_storage_slots[9] as GeneralInventorySlot).accessibility_name
|
||||
== "locked storage slot 10"
|
||||
)
|
||||
var storage_wallet := PlayerWallet.new()
|
||||
scene_root.add_child(storage_wallet)
|
||||
assert(storage_wallet.restore_balance(9500))
|
||||
for expected_capacity: int in [18, 27, 36, 45, 54, 63, 72]:
|
||||
assert(capacity.purchase(storage_wallet))
|
||||
assert(layout.get_storage_capacity() == expected_capacity)
|
||||
assert(storage_grid.get_slots().size() == expected_capacity)
|
||||
assert(not capacity.can_purchase(wallet))
|
||||
assert(not capacity.purchase(wallet))
|
||||
assert(home_state.upgrade_to_next_tier())
|
||||
assert(layout.get_storage_capacity() == 18)
|
||||
assert(storage_grid.get_slots().size() == 18)
|
||||
assert(not home_state.upgrade_to_next_tier())
|
||||
assert(capacity.get_next_capacity() == -1)
|
||||
assert(capacity.get_next_cost() == -1)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue