summaryrefslogtreecommitdiff
path: root/Tests/Terminal/test_OutputBlock.gd
blob: f0c2b2997ba60ca0c08e2da2b1fbc6076ca863d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
extends GutTest

const Scene = preload("res://Scenes/Terminal/OutputBlock.tscn")
const OutputBlock = preload("res://Scripts/Terminal/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.instantiate())

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').text, '')

func test_setting_Content_sets_ContentLabel_bbcode_text():
	_instance.Content = 'test'
	assert_eq(_instance.get_node('ContentLabel').text, 'test')