summaryrefslogtreecommitdiff
path: root/Tests/Game/test_StatusLine.gd
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/Game/test_StatusLine.gd')
-rw-r--r--Tests/Game/test_StatusLine.gd32
1 files changed, 32 insertions, 0 deletions
diff --git a/Tests/Game/test_StatusLine.gd b/Tests/Game/test_StatusLine.gd
new file mode 100644
index 0000000..b22f624
--- /dev/null
+++ b/Tests/Game/test_StatusLine.gd
@@ -0,0 +1,32 @@
+extends GutTest
+
+const Scene = preload("res://Scenes/Game/StatusLine.tscn")
+const StatusLine = preload("res://Scripts/Game/StatusLine.cs")
+
+var _instance: StatusLine = null
+
+func _get_title_label() -> RichTextLabel:
+ return _instance.get_node('%TitleLabel') as RichTextLabel
+
+func before_each():
+ _instance = add_child_autofree(Scene.instance())
+
+func after_all():
+ assert_no_new_orphans()
+
+func test_can_be_instantiated():
+ assert_not_null(_instance)
+
+func test_Title_is_empty_after_instantiation():
+ assert_true(_instance.Title.empty())
+
+func test_TitleLabel_is_empty_after_instantiation():
+ assert_true(_get_title_label().text.empty())
+
+func test_setting_Title_to_a_non_empty_string_makes_TitleLable_non_empty():
+ _instance.Title = 'this is a test title'
+ assert_false(_get_title_label().text.empty())
+
+func test_setting_Title_sets_the_bbcode_text_property_on_TitleLabel():
+ _instance.Title = '[wave]this is a test title[/wave]'
+ assert_false(_get_title_label().bbcode_text.empty())