Reduce answer review scroll redraws
This commit is contained in:
@@ -22,6 +22,7 @@ func _initialize() -> void:
|
||||
_test_feedback_context_excludes_study_content()
|
||||
_test_feedback_form_validation()
|
||||
_test_revisitable_navigation_prefers_unanswered_questions()
|
||||
_test_timer_text_avoids_redundant_frame_updates()
|
||||
_test_submit_styles_keep_stable_geometry()
|
||||
_test_core_timer_counts_up_and_remains_visible()
|
||||
await _test_player_runtime_construction()
|
||||
@@ -347,6 +348,20 @@ func _test_revisitable_navigation_prefers_unanswered_questions() -> void:
|
||||
session.current_index = prior_index
|
||||
|
||||
|
||||
func _test_timer_text_avoids_redundant_frame_updates() -> void:
|
||||
var player = load("res://scripts/ui/question_player.gd").new()
|
||||
player.timer_label = Label.new()
|
||||
player._set_timer_display(65)
|
||||
_assert(player.timer_label.text == "01:05", "timer should render a changed second")
|
||||
player.timer_label.text = "unchanged"
|
||||
player._set_timer_display(65)
|
||||
_assert(player.timer_label.text == "unchanged", "timer should not rewrite its label every frame")
|
||||
player._set_timer_display(66)
|
||||
_assert(player.timer_label.text == "01:06", "timer should render the next changed second")
|
||||
player.timer_label.free()
|
||||
player.free()
|
||||
|
||||
|
||||
func _test_player_runtime_construction() -> void:
|
||||
var host := Control.new()
|
||||
root.add_child(host)
|
||||
|
||||
Reference in New Issue
Block a user