diff options
| author | Sophia Pearson <codergal89@gmail.com> | 2022-09-05 20:35:53 +0200 |
|---|---|---|
| committer | Sophia Pearson <codergal89@gmail.com> | 2022-09-05 20:35:53 +0200 |
| commit | f20bd89dc4a7bf14a88b1effcaa1887b29314525 (patch) | |
| tree | d114787f68efd2a7d61d95fa9c84e8e5d69a7c11 /Tests/Terminal/test_StatusArea.gd | |
| parent | 1b477b62f8be8c546a35dbd1d2688ebf623c496f (diff) | |
| download | texty-f20bd89dc4a7bf14a88b1effcaa1887b29314525.tar.xz texty-f20bd89dc4a7bf14a88b1effcaa1887b29314525.zip | |
gui: split GUI into Terminal components
Diffstat (limited to 'Tests/Terminal/test_StatusArea.gd')
| -rw-r--r-- | Tests/Terminal/test_StatusArea.gd | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/Tests/Terminal/test_StatusArea.gd b/Tests/Terminal/test_StatusArea.gd new file mode 100644 index 0000000..8277210 --- /dev/null +++ b/Tests/Terminal/test_StatusArea.gd @@ -0,0 +1,32 @@ +extends GutTest + +const Scene = preload("res://Scenes/Terminal/StatusArea.tscn") +const StatusLine = preload("res://Scripts/Terminal/StatusArea.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()) |
