feat(client): ConsideringIndicator — rotates think-lines on a Timer
This commit is contained in:
19
client/tests/unit/test_considering_indicator.gd
Normal file
19
client/tests/unit/test_considering_indicator.gd
Normal file
@@ -0,0 +1,19 @@
|
||||
extends "res://addons/gut/test.gd"
|
||||
|
||||
const ConsideringIndicator = preload("res://scripts/ui/considering_indicator.gd")
|
||||
const ConsideringPhrases = preload("res://scripts/ui/considering_phrases.gd")
|
||||
|
||||
|
||||
func test_start_shows_first_phrase_and_stop_clears():
|
||||
# Point phrases at a missing file so next() is deterministically LAST_RESORT.
|
||||
var phrases = ConsideringPhrases.new("res://content/does_not_exist.json")
|
||||
var ind = ConsideringIndicator.new(phrases)
|
||||
add_child_autofree(ind) # _ready() creates the Timer child
|
||||
var label := Label.new()
|
||||
add_child_autofree(label)
|
||||
|
||||
ind.start(label)
|
||||
assert_eq(label.text, ConsideringPhrases.LAST_RESORT) # first phrase shown at once
|
||||
|
||||
ind.stop()
|
||||
assert_eq(label.text, "") # cleared on stop
|
||||
Reference in New Issue
Block a user