Skip to content

Commit

Permalink
Add test for remove_pool
Browse files Browse the repository at this point in the history
  • Loading branch information
shomykohai committed Oct 9, 2024
1 parent 24a5cd3 commit 47bc5f5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tests/quest_manager_test.gd
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,18 @@ func test_get_quest_property() -> void:
#region: Manager API

func test_add_new_pool() -> void:
QuestSystem.add_new_pool(base_pool_path, "TestPool")
var new_pool: BaseQuestPool = QuestSystem.get_pool("TestPool")
QuestSystem.add_new_pool(base_pool_path, &"NewPool")
var new_pool: BaseQuestPool = QuestSystem.get_pool(&"NewPool")
assert_array(QuestSystem.get_all_pools()).contains([new_pool])
new_pool.queue_free()
await new_pool.tree_exited
QuestSystem.remove_pool(&"NewPool")

func test_remove_pool() -> void:
QuestSystem.add_new_pool(base_pool_path, &"NewPool")
var new_pool: BaseQuestPool = QuestSystem.get_pool(&"NewPool")
assert_array(QuestSystem.get_all_pools()).contains([new_pool])
QuestSystem.remove_pool(&"NewPool")
await get_tree().process_frame # Wait a frame for queue_free to take action
assert_array(QuestSystem.get_all_pools()).not_contains([new_pool])

func test_get_pool() -> void:
assert_object(QuestSystem.get_pool("Active")).is_not_null()
Expand Down

0 comments on commit 47bc5f5

Please sign in to comment.