From f711d55d465bd8838dc55bde1f4a25d582a6bb6b Mon Sep 17 00:00:00 2001 From: Sophia Pearson Date: Sun, 4 Sep 2022 21:52:27 +0200 Subject: tests: adjust tests to new design --- Tests/Game/test_OutputBlock.gd | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Tests/Game/test_OutputBlock.gd (limited to 'Tests/Game/test_OutputBlock.gd') diff --git a/Tests/Game/test_OutputBlock.gd b/Tests/Game/test_OutputBlock.gd new file mode 100644 index 0000000..c7addfe --- /dev/null +++ b/Tests/Game/test_OutputBlock.gd @@ -0,0 +1,32 @@ +extends GutTest + +const Scene = preload("res://Scenes/Game/OutputBlock.tscn") +const OutputBlock = preload("res://Scripts/Game/OutputBlock.cs") + +const _input_text_changed = 'InputTextChanged' +const _output_text_changed = 'OutputTextChanged' +const _test_data = 'This is some test data' +var _instance: OutputBlock = null + + +func before_each(): + _instance = add_child_autofree(Scene.instance()) + +func after_all(): + assert_no_new_orphans() + +func test_can_instantiate(): + assert_not_null(_instance) + +func test_Content_is_empty_after_instantiation(): + assert_eq(_instance.Content, '') + +func test_ContentLabel_bbcode_enabled_is_enabled_after_instantiation(): + assert_true(_instance.get_node('ContentLabel').bbcode_enabled) + +func test_ContentLabel_is_empty_after_instantiation(): + assert_eq(_instance.get_node('ContentLabel').bbcode_text, '') + +func test_setting_Content_sets_ContentLabel_bbcode_text(): + _instance.Content = 'test' + assert_eq(_instance.get_node('ContentLabel').bbcode_text, 'test') -- cgit v1.2.3